Skip to content

Rack::Chunked middleware conflicts with Rack::Sendfile #1266

Description

@boazsegev

The Rack::Chunked middleware conflict with the Rack::Sendfile middleware / approach.

The Rack::Chunked doesn't test if the 'X-Sendfile' header family is set, adding the chunked transfer encoding header.

This results in two possible approaches:

  1. The server ignores any headers set by the application (losing any cookie data or other custom headers).

  2. The encoding header remains intact*, causing the response to fail.

Both approaches result in loss of data (either the cookie data or a failed response).

The best way to fix the issue might be to add tests to the Rack::Chunked middleware, testing for the 'X-Sendfile' header family.

* Consider that the header might have been Transfer-Encoding: gzip and the file X-sendfile: style.css.gz, which means that the header should have remained intact.

This issue originated here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions