mirror of https://github.com/rwf2/Rocket.git
Clean up 'Server' header commentary.
This commit is contained in:
parent
9f75e0f443
commit
7c2dda2647
|
@ -216,12 +216,13 @@ impl Rocket {
|
||||||
// Route the request and run the user's handlers.
|
// Route the request and run the user's handlers.
|
||||||
let mut response = self.route_and_process(request, data);
|
let mut response = self.route_and_process(request, data);
|
||||||
|
|
||||||
// Add the 'rocket' server header to the response and run fairings only if the header
|
// Add a default 'Server' header if it isn't already there.
|
||||||
// doesn't already exist.
|
|
||||||
// TODO: If removing Hyper, write out `Date` header too.
|
// TODO: If removing Hyper, write out `Date` header too.
|
||||||
if !response.headers().contains("Server") {
|
if !response.headers().contains("Server") {
|
||||||
response.set_header(Header::new("Server", "Rocket"));
|
response.set_header(Header::new("Server", "Rocket"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run the response fairings.
|
||||||
self.fairings.handle_response(request, &mut response);
|
self.fairings.handle_response(request, &mut response);
|
||||||
|
|
||||||
// Strip the body if this is a `HEAD` request.
|
// Strip the body if this is a `HEAD` request.
|
||||||
|
|
Loading…
Reference in New Issue