Skip to content

Commit

Permalink
object_store: Display for GetRange includes bytes=
Browse files Browse the repository at this point in the history
  • Loading branch information
clbarnes committed Jan 3, 2024
1 parent c5c6b6e commit aade898
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion object_store/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ impl GetOptionsExt for RequestBuilder {
use hyper::header::*;

if let Some(range) = options.range {
self = self.header(RANGE, format!("bytes={range}"));
self = self.header(RANGE, range.to_string());
}

if let Some(tag) = options.if_match {
Expand Down
6 changes: 3 additions & 3 deletions object_store/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ impl GetRange {
impl Display for GetRange {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Bounded(r) => f.write_fmt(format_args!("{}-{}", r.start, r.end - 1)),
Self::Offset(o) => f.write_fmt(format_args!("{o}-")),
Self::Suffix(n) => f.write_fmt(format_args!("-{n}")),
Self::Bounded(r) => f.write_fmt(format_args!("bytes={}-{}", r.start, r.end - 1)),
Self::Offset(o) => f.write_fmt(format_args!("bytes={o}-")),
Self::Suffix(n) => f.write_fmt(format_args!("bytes=-{n}")),
}
}
}
Expand Down

0 comments on commit aade898

Please sign in to comment.