vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit a03db6d2241dfc6e138136c5ffaa840a7680e872
parent 8d1b72b9512b90775e671b7ba08cd552a0aabd13
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Fri,  6 Dec 2019 22:55:29 +0100

Also hide options requests, unless using debug or trace

Diffstat:
Msrc/util.rs | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/util.rs b/src/util.rs @@ -147,15 +147,22 @@ impl Fairing for BetterLogging { } fn on_request(&self, request: &mut Request<'_>, _data: &Data) { + let method = request.method(); + if !self.0 && method == Method::Options { + return; + } let mut uri = request.uri().to_string(); uri.truncate(50); if self.0 || LOGGED_ROUTES.iter().any(|r| uri.starts_with(r)) { - info!(target: "request", "{} {}", request.method(), uri); + info!(target: "request", "{} {}", method, uri); } } fn on_response(&self, request: &Request, response: &mut Response) { + if !self.0 && request.method() == Method::Options { + return; + } let uri = request.uri().to_string(); if self.0 || LOGGED_ROUTES.iter().any(|r| uri.starts_with(r)) { let status = response.status();