Skip to content

Commit

Permalink
Be compliant with rfc7233 for sending a 206 response.
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMasterK committed Dec 8, 2023
1 parent 118c005 commit c3b78de
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
}
}

let has_range = query.has("range");

let qs = {
let collected = query
.into_pairs()
Expand Down Expand Up @@ -430,7 +428,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
if let Some(mime_type) = mime_type {
response.content_type(mime_type);
}
if has_range {
if req.headers().contains_key("range") {
response.status(StatusCode::PARTIAL_CONTENT);
}
let transformed_stream = UmpTransformStream::new(resp);
Expand Down

0 comments on commit c3b78de

Please sign in to comment.