mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 19:32:20 +00:00
vmm: http_endpoint: Do not sent 200 status code when our body is empty
Otherwise HTTP client will not close the connection and wait for a pending body. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
ede262684d
commit
f34ace7673
@ -81,7 +81,7 @@ impl EndpointHandler for VmCreate {
|
|||||||
match vm_create(api_notifier, api_sender, Arc::new(vm_config))
|
match vm_create(api_notifier, api_sender, Arc::new(vm_config))
|
||||||
.map_err(HttpError::VmCreate)
|
.map_err(HttpError::VmCreate)
|
||||||
{
|
{
|
||||||
Ok(_) => Response::new(Version::Http11, StatusCode::OK),
|
Ok(_) => Response::new(Version::Http11, StatusCode::NoContent),
|
||||||
Err(e) => error_response(e, StatusCode::InternalServerError),
|
Err(e) => error_response(e, StatusCode::InternalServerError),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ impl EndpointHandler for VmActionHandler {
|
|||||||
ApiError::VmResume(_) => HttpError::VmResume(e),
|
ApiError::VmResume(_) => HttpError::VmResume(e),
|
||||||
_ => HttpError::VmAction(e),
|
_ => HttpError::VmAction(e),
|
||||||
}) {
|
}) {
|
||||||
Ok(_) => Response::new(Version::Http11, StatusCode::OK),
|
Ok(_) => Response::new(Version::Http11, StatusCode::NoContent),
|
||||||
Err(e) => error_response(e, StatusCode::InternalServerError),
|
Err(e) => error_response(e, StatusCode::InternalServerError),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user