Merge pull request #1013 from ethcore/ff-fix
Fixing Firefox authorization issues
This commit is contained in:
commit
0260e9322a
@ -68,6 +68,7 @@ impl Authorization for HttpBasicAuth {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
enum Access {
|
enum Access {
|
||||||
Granted,
|
Granted,
|
||||||
Denied,
|
Denied,
|
||||||
@ -116,7 +117,7 @@ impl server::Handler<HttpStream> for UnauthorizedHandler {
|
|||||||
res.set_status(StatusCode::Unauthorized);
|
res.set_status(StatusCode::Unauthorized);
|
||||||
Next::write()
|
Next::write()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_response_writable(&mut self, encoder: &mut Encoder<HttpStream>) -> Next {
|
fn on_response_writable(&mut self, encoder: &mut Encoder<HttpStream>) -> Next {
|
||||||
let response = "Unauthorized".as_bytes();
|
let response = "Unauthorized".as_bytes();
|
||||||
|
|
||||||
@ -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 {
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user