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

nixos/nginx: serve unknown MIME-Types as binary #111302

Merged
merged 1 commit into from Feb 9, 2021
Merged

nixos/nginx: serve unknown MIME-Types as binary #111302

merged 1 commit into from Feb 9, 2021

Conversation

fooker
Copy link
Contributor

@fooker fooker commented Jan 30, 2021

The built-in default for unknown MIME-Types is text/plain whereas the
upstream default config changes it to application/octet-stream. By
changing the default tpye, unknown files will be downloaded by browsers
instead of being displayed.

See https://trac.nginx.org/nginx/browser/conf/nginx.conf#L19

Motivation for this change

Serving binary files as "displayable" is more wrong than serving text files as binary.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The built-in default for unknown MIME-Types is `text/plain` whereas the
upstream default config changes it to `application/octet-stream`. By
changing the default tpye, unknown files will be downloaded by browsers
instead of being displayed.
Copy link
Member

@vincentbernat vincentbernat left a comment

Choose a reason for hiding this comment

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

Good for me!

Copy link
Member

@mweinelt mweinelt left a comment

Choose a reason for hiding this comment

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

SGTM.

@mweinelt mweinelt merged commit 47901b5 into NixOS:master Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants