Skip to content

Breaking change in handling requests with Range in v0.15.1 and v0.15.2 #1772

@sergio-nsk

Description

@sergio-nsk

Request:

GET /range.bin HTTP/1.1
Host: 127.0.0.1:18080
Range: bytes=1000-
Accept: */*
Connection: TE
gzip
Accept-Language: en-us, en;q=0.9

The server .Get() handler:

    response.status = 401;
    response.set_header("WWW-Authenticate", "Basic realm=123456");

Expected response:

HTTP/1.1 401 Unauthorized
Connection: close
Content-Length: 0
WWW-Authenticate: Basic realm=123456

Actual Response:

HTTP/1.1 416 Range Not Satisfiable
Connection: close
Content-Length: 0
WWW-Authenticate: Basic realm=123456

Here fceada9:
detail::normalize_ranges(req, res) should not be called if res.status is not 2xx or even is neither 200 nor 206.

There is a typo in the comment a few lines above that call:

--- // Rounting
+++ // Routing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions