Log to info when Fairing's `on_response` changes
the status code of a 404 OPTIONS Fixes #20
This commit is contained in:
parent
92d7775b93
commit
8eb782a7ca
|
@ -105,6 +105,10 @@ fn on_response_wrapper(
|
|||
if request.method() == http::Method::Options && request.method() == http::Method::Options &&
|
||||
request.route().is_none()
|
||||
{
|
||||
info_!(
|
||||
"CORS Fairing: Turned missing route {} into an OPTIONS pre-flight request",
|
||||
request
|
||||
);
|
||||
response.set_status(Status::NoContent);
|
||||
let _ = response.take_body();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue