Skip to content

Commit 6178519

Browse files
tottotoseanmonstar
authored andcommitted
fix: make AcceptRanges::is_bytes method to check only inner value
1 parent cd5155d commit 6178519

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/common/accept_ranges.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use http::HeaderValue;
2-
31
use util::FlatCsv;
42

53
/// `Accept-Ranges` header, defined in [RFC7233](http://tools.ietf.org/html/rfc7233#section-2.3)
@@ -36,12 +34,12 @@ derive_header! {
3634
name: ACCEPT_RANGES
3735
}
3836

39-
const ACCEPT_RANGES_BYTES: HeaderValue = ::HeaderValue::from_static("bytes");
37+
const ACCEPT_RANGES_BYTES: &str = "bytes";
4038

4139
impl AcceptRanges {
4240
/// A constructor to easily create the common `Accept-Ranges: bytes` header.
4341
pub fn bytes() -> Self {
44-
AcceptRanges(ACCEPT_RANGES_BYTES.into())
42+
AcceptRanges(::HeaderValue::from_static(ACCEPT_RANGES_BYTES).into())
4543
}
4644

4745
/// Check if the unit is `bytes`.

0 commit comments

Comments
 (0)