Skip to content

Commit

Permalink
fix(cmn): use bytes=... when sending as well
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Byron committed Apr 11, 2015
1 parent 3cef120 commit b9a469c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rust/api/cmn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("*"))
Expand Down
4 changes: 2 additions & 2 deletions src/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit b9a469c

Please sign in to comment.