Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow compression for partial content #3429

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

valaphee
Copy link

@valaphee valaphee commented Jul 13, 2024

PR Type

Bug Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Currently, Content-Encoding: identity is used to prevent compression. But per RFC it should not be send, and Firefox seems to error if Ranges are combined with Content-Encoding. This PR solves the error by removing the usage of the header and stop the middleware from compressing Partial Content as the compression middleware will never be able to compress this kind of response.

Fixes #3191

@valaphee
Copy link
Author

valaphee commented Jul 13, 2024

Content-Encoding: identity will still be emitted when explicitly asking for an encoding in NamedFile. But doesn't seem to cause any problems with Firefox.

But ideally it should be stripped.

@robjtede robjtede added A-files project: actix-files B-semver-patch labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-files project: actix-files B-semver-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

actix-files: Range request for static HTML file results in Content Encoding Error
2 participants