Skip to content

Commit

Permalink
fix panic in removing Authorization header during redirect
Browse files Browse the repository at this point in the history
Closes #171
  • Loading branch information
seanmonstar committed Jul 25, 2017
1 parent 2d11a4b commit cf246d0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/redirect.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt;

use hyper::header::{Headers, Authorization, Cookie};
use hyper::header::{Headers};

use Url;

Expand Down Expand Up @@ -198,8 +198,8 @@ pub fn remove_sensitive_headers(headers: &mut Headers, next: &Url, previous: &[U
let cross_host = next.host_str() != previous.host_str() ||
next.port_or_known_default() != previous.port_or_known_default();
if cross_host {
headers.remove::<Authorization<String>>();
headers.remove::<Cookie>();
headers.remove_raw("authorization");
headers.remove_raw("cookie");
headers.remove_raw("cookie2");
headers.remove_raw("www-authenticate");
}
Expand Down Expand Up @@ -260,7 +260,7 @@ fn test_redirect_policy_custom() {

#[test]
fn test_remove_sensitive_headers() {
use hyper::header::Accept;
use hyper::header::{Accept, Authorization, Cookie};

let mut headers = Headers::new();
headers.set(Accept::star());
Expand Down

0 comments on commit cf246d0

Please sign in to comment.