Skip to content

Conversation

@Sztig
Copy link
Contributor

@Sztig Sztig commented Jan 2, 2026

🎫 Issue IBX-11131

Description:

Apache using php-fpm is causing issues when streaming content on chromium based browsers.

I've changed the response to 206 even when providing full files.

Copy link
Contributor

@Steveb-p Steveb-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this is expected behavior based on what I've found on the web.

See Partial request responses

There are three relevant statuses, when working with range requests:

A successful range request elicits a 206 Partial Content status from the server.
A range request that is out of bounds will result in a 416 Requested Range Not Satisfiable status, meaning that none of the range values overlap the extent of the resource. For example, the first-byte-pos of every range might be greater than the resource length.
If range requests are not supported, an 200 OK status is sent back and the entire response body is transmitted.

So I agree, even for full-length response including whole file, if the client asks for a range, we should respond with 206 unless going out of bounds.

$this->maxlen = $end - $start + 1;
$this->offset = $start;

$this->setStatusCode(206); // HTTP_PARTIAL_CONTENT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$this->setStatusCode(206); // HTTP_PARTIAL_CONTENT
$this->setStatusCode(Response::HTTP_PARTIAL_CONTENT);


if ($start <= $end) {
if ($start < 0 || $end > $fileSize - 1) {
$this->setStatusCode(416); // HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and while we are close and at it:

Suggested change
$this->setStatusCode(416); // HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
$this->setStatusCode(Response::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE);

@Steveb-p Steveb-p added Bug Something isn't working Ready for review labels Jan 4, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants