Skip to content

Commit

Permalink
Response: Allow manual handling of Range requests
Browse files Browse the repository at this point in the history
While waiting for built-in support of Range requests, issue#12, this allows
tiny-http to be used for manual implementations.
  • Loading branch information
rawler committed Aug 31, 2020
1 parent f4da4cd commit 8792f53
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/response.rs
Expand Up @@ -15,9 +15,7 @@ use std::str::FromStr;
/// Some headers cannot be changed. Trying to define the value
/// of one of these will have no effect:
///
/// - `Accept-Ranges`
/// - `Connection`
/// - `Content-Range`
/// - `Trailer`
/// - `Transfer-Encoding`
/// - `Upgrade`
Expand Down Expand Up @@ -240,9 +238,7 @@ where
let header = header.into();

// ignoring forbidden headers
if header.field.equiv(&"Accept-Ranges")
|| header.field.equiv(&"Connection")
|| header.field.equiv(&"Content-Range")
if header.field.equiv(&"Connection")
|| header.field.equiv(&"Trailer")
|| header.field.equiv(&"Transfer-Encoding")
|| header.field.equiv(&"Upgrade")
Expand Down

0 comments on commit 8792f53

Please sign in to comment.