store basic auth in cache on redirect response

This commit is contained in:
Bryan Gilbert 2016-09-14 16:12:40 -04:00
parent 82e45a403f
commit 0bcd04d2ab

View file

@ -1017,7 +1017,8 @@ pub fn load<A, B>(load_data: &LoadData,
new_auth_header = None;
if let Some(auth_header) = request_headers.get::<Authorization<Basic>>() {
if response.status().class() == StatusClass::Success {
if response.status().class() == StatusClass::Success ||
response.status().class() == StatusClass::Redirection {
let auth_entry = AuthCacheEntry {
user_name: auth_header.username.to_owned(),
password: auth_header.password.to_owned().unwrap(),