Skip to content

Commit

Permalink
fix: make AcceptRanges::is_bytes method to check only inner value
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored and seanmonstar committed Mar 4, 2024
1 parent cd5155d commit 6178519
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/common/accept_ranges.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use http::HeaderValue;

use util::FlatCsv;

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

const ACCEPT_RANGES_BYTES: HeaderValue = ::HeaderValue::from_static("bytes");
const ACCEPT_RANGES_BYTES: &str = "bytes";

impl AcceptRanges {
/// A constructor to easily create the common `Accept-Ranges: bytes` header.
pub fn bytes() -> Self {
AcceptRanges(ACCEPT_RANGES_BYTES.into())
AcceptRanges(::HeaderValue::from_static(ACCEPT_RANGES_BYTES).into())
}

/// Check if the unit is `bytes`.
Expand Down

0 comments on commit 6178519

Please sign in to comment.