Fixing Firefox authorization issues

This commit is contained in:
Tomasz Drwięga 2016-04-28 11:50:45 +02:00
parent c2787d80c8
commit 5ef2605cbc
2 changed files with 4 additions and 3 deletions

View File

@ -68,6 +68,7 @@ impl Authorization for HttpBasicAuth {
} }
} }
#[derive(Debug)]
enum Access { enum Access {
Granted, Granted,
Denied, Denied,
@ -151,7 +152,7 @@ impl server::Handler<HttpStream> for AuthRequiredHandler {
fn on_response(&mut self, res: &mut server::Response) -> Next { fn on_response(&mut self, res: &mut server::Response) -> Next {
res.set_status(StatusCode::Unauthorized); res.set_status(StatusCode::Unauthorized);
res.headers_mut().set_raw("WWW-Authenticate", vec![b"Basic realm=\"Parity\"".to_vec()]); 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<HttpStream>) -> Next { fn on_response_writable(&mut self, _encoder: &mut Encoder<HttpStream>) -> Next {

View File

@ -45,7 +45,7 @@ impl server::Handler<HttpStream> for Redirection {
fn on_response(&mut self, res: &mut server::Response) -> Next { fn on_response(&mut self, res: &mut server::Response) -> Next {
res.set_status(StatusCode::MovedPermanently); res.set_status(StatusCode::MovedPermanently);
res.headers_mut().set(header::Location(self.to_url.to_owned())); res.headers_mut().set(header::Location(self.to_url.to_owned()));
Next::end() Next::write()
} }
fn on_response_writable(&mut self, _encoder: &mut Encoder<HttpStream>) -> Next { fn on_response_writable(&mut self, _encoder: &mut Encoder<HttpStream>) -> Next {
Next::end() Next::end()