Skip to content

Commit

Permalink
fix etag range headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Oct 14, 2022
1 parent 235c654 commit 050bcb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iroh-gateway/src/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ pub fn set_etag_headers(headers: &mut HeaderMap, etag: String) {
pub fn add_etag_range(headers: &mut HeaderMap, range: Range<u64>) {
if headers.contains_key(ETAG) {
let etag = headers.get(ETAG).unwrap().to_str().unwrap();
let etag = format!("{}.{}-{}", etag, range.start, range.end - 1);
let etag = etag.trim_end_matches('"');
let etag = format!("{}.{}-{}\"", etag, range.start, range.end - 1);
headers.insert(ETAG, HeaderValue::from_str(&etag).unwrap());
}
}
Expand Down

0 comments on commit 050bcb5

Please sign in to comment.