Skip to content

[πŸ› BUG]: HTTP middlewares need specific order to work Β #1501

Description

@FluffyDiscord

No duplicates πŸ₯².

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

Currently you need to have your RR middleware in specific order or else it might not work.

The following middleware order will fail to serve content/payload in the browser that is more than 4KB if the gzip is before sendfile.

http:
    middleware: [ "static", "gzip", "sendfile" ]

However moving gzip after sendfile makes that everything works as expected.

http:
    middleware: [ "static", "sendfile", "gzip" ]

The middleware order should not matter or if this is a RR limitation, it needs to be mentioned in docs.

Version (rr --version)

2.12.3

How to reproduce the issue?

Use the following middleware order:

http:
    middleware: [ "static", "gzip", "sendfile" ]

and try sending content to the worker, the loading browser will fail with error net::ERR_CONTENT_DECODING_FAILED (Chromium).

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions