vmm: api: Set the HTTP response header Server field

To "Cloud Hypervisor API" and not "Firecracker API".

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-10-04 08:46:54 +02:00
parent fc5c210498
commit 2a466132a0
+2 -1
View File
@@ -82,7 +82,7 @@ fn http_serve<T: Read + Write>(
while let Some(request) = http_connection.pop_parsed_request() { while let Some(request) = http_connection.pop_parsed_request() {
let sender = api_sender.clone(); let sender = api_sender.clone();
let path = request.uri().get_abs_path().to_string(); let path = request.uri().get_abs_path().to_string();
let response = match HTTP_ROUTES.routes.get(&path) { let mut response = match HTTP_ROUTES.routes.get(&path) {
Some(route) => match api_notifier.try_clone() { Some(route) => match api_notifier.try_clone() {
Ok(notifier) => route.handle_request(&request, notifier, sender), Ok(notifier) => route.handle_request(&request, notifier, sender),
Err(_) => Response::new(Version::Http11, StatusCode::InternalServerError), Err(_) => Response::new(Version::Http11, StatusCode::InternalServerError),
@@ -90,6 +90,7 @@ fn http_serve<T: Read + Write>(
None => Response::new(Version::Http11, StatusCode::NotFound), None => Response::new(Version::Http11, StatusCode::NotFound),
}; };
response.set_server("Cloud Hypervisor API");
http_connection.enqueue_response(response); http_connection.enqueue_response(response);
} }
} }