From 5ef2605cbca55e3b3a5e37231a9c08559164f949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 28 Apr 2016 11:50:45 +0200 Subject: [PATCH] Fixing Firefox authorization issues --- webapp/src/router/auth.rs | 5 +++-- webapp/src/router/redirect.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/src/router/auth.rs b/webapp/src/router/auth.rs index 95e86b51a..d9933b51c 100644 --- a/webapp/src/router/auth.rs +++ b/webapp/src/router/auth.rs @@ -68,6 +68,7 @@ impl Authorization for HttpBasicAuth { } } +#[derive(Debug)] enum Access { Granted, Denied, @@ -116,7 +117,7 @@ impl server::Handler for UnauthorizedHandler { res.set_status(StatusCode::Unauthorized); Next::write() } - + fn on_response_writable(&mut self, encoder: &mut Encoder) -> Next { let response = "Unauthorized".as_bytes(); @@ -151,7 +152,7 @@ impl server::Handler for AuthRequiredHandler { fn on_response(&mut self, res: &mut server::Response) -> Next { res.set_status(StatusCode::Unauthorized); res.headers_mut().set_raw("WWW-Authenticate", vec![b"Basic realm=\"Parity\"".to_vec()]); - Next::end() + Next::write() } fn on_response_writable(&mut self, _encoder: &mut Encoder) -> Next { diff --git a/webapp/src/router/redirect.rs b/webapp/src/router/redirect.rs index a78df4046..f308635cd 100644 --- a/webapp/src/router/redirect.rs +++ b/webapp/src/router/redirect.rs @@ -45,7 +45,7 @@ impl server::Handler for Redirection { fn on_response(&mut self, res: &mut server::Response) -> Next { res.set_status(StatusCode::MovedPermanently); res.headers_mut().set(header::Location(self.to_url.to_owned())); - Next::end() + Next::write() } fn on_response_writable(&mut self, _encoder: &mut Encoder) -> Next { Next::end()