From b9a469c0a4e655da54940dc2876559f573c88c08 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 11 Apr 2015 09:31:23 +0200 Subject: [PATCH] fix(cmn): use bytes=... when sending as well Previously, `bytes=` was just parsed, but not sent to the server. This change is motivated by a similar change in this commit: http://goo.gl/AvyvLb --- src/rust/api/cmn.rs | 2 +- src/rust/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rust/api/cmn.rs b/src/rust/api/cmn.rs index a5ad2e0ecb..dbef7eabc4 100644 --- a/src/rust/api/cmn.rs +++ b/src/rust/api/cmn.rs @@ -440,7 +440,7 @@ impl Header for ContentRange { impl HeaderFormat for ContentRange { fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - try!(fmt.write_str("bytes ")); + try!(fmt.write_str("bytes=")); match self.range { Some(ref c) => try!(c.fmt(fmt)), None => try!(fmt.write_str("*")) diff --git a/src/rust/lib.rs b/src/rust/lib.rs index 36652000ba..3d83620ff5 100644 --- a/src/rust/lib.rs +++ b/src/rust/lib.rs @@ -129,9 +129,9 @@ bar\r\n\ #[test] fn content_range() { for &(ref c, ref expected) in - &[(ContentRange {range: None, total_length: 50 }, "Content-Range: bytes */50\r\n"), + &[(ContentRange {range: None, total_length: 50 }, "Content-Range: bytes=*/50\r\n"), (ContentRange {range: Some(Chunk { first: 23, last: 40 }), total_length: 45}, - "Content-Range: bytes 23-40/45\r\n")] { + "Content-Range: bytes=23-40/45\r\n")] { let mut headers = hyper::header::Headers::new(); headers.set(c.clone()); assert_eq!(headers.to_string(), expected.to_string());