Skip to content

Commit b9a469c

Browse files
committed
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
1 parent 3cef120 commit b9a469c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/rust/api/cmn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ impl Header for ContentRange {
440440

441441
impl HeaderFormat for ContentRange {
442442
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
443-
try!(fmt.write_str("bytes "));
443+
try!(fmt.write_str("bytes="));
444444
match self.range {
445445
Some(ref c) => try!(c.fmt(fmt)),
446446
None => try!(fmt.write_str("*"))

src/rust/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ bar\r\n\
129129
#[test]
130130
fn content_range() {
131131
for &(ref c, ref expected) in
132-
&[(ContentRange {range: None, total_length: 50 }, "Content-Range: bytes */50\r\n"),
132+
&[(ContentRange {range: None, total_length: 50 }, "Content-Range: bytes=*/50\r\n"),
133133
(ContentRange {range: Some(Chunk { first: 23, last: 40 }), total_length: 45},
134-
"Content-Range: bytes 23-40/45\r\n")] {
134+
"Content-Range: bytes=23-40/45\r\n")] {
135135
let mut headers = hyper::header::Headers::new();
136136
headers.set(c.clone());
137137
assert_eq!(headers.to_string(), expected.to_string());

0 commit comments

Comments
 (0)