Fixes #211 and adds one test for it.

This commit is contained in:
Pyfisch
2014-12-29 12:15:08 +01:00
parent 27b262c226
commit 5fccdea90d
2 changed files with 10 additions and 0 deletions

View File

@@ -544,6 +544,9 @@ pub fn read_header<R: Reader>(stream: &mut R) -> HttpResult<Option<RawHeaderLine
}
};
}
// Remove optional trailing whitespace
let real_len = value.len() - value.iter().rev().take_while(|&&x| b' ' == x).count();
value.truncate(real_len);
debug!("header value = {}", value[].to_ascii());