From 8eb782a7caf44b8d18b9c95f52b47be8aed0e060 Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Mon, 24 Jul 2017 13:55:35 +0800 Subject: [PATCH] Log to info when Fairing's `on_response` changes the status code of a 404 OPTIONS Fixes #20 --- src/fairing.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fairing.rs b/src/fairing.rs index 7c961b1..3501583 100644 --- a/src/fairing.rs +++ b/src/fairing.rs @@ -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(); }