Repository navigation
fix(nginx): use text/csv in gzip_types instead of test/csv - #714
Open
gu-feng418 wants to merge 1 commit into
Open
gu-feng418 wants to merge 1 commit into
gu-feng418 wants to merge 1 commit into
Conversation
The agent, origin and proxy templates listed "test/csv", which is not a registered MIME type, so nginx never matched it and CSV responses were served uncompressed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
gzip_typesin the agent, origin and proxy nginx templates listedtest/csv, which is not a MIME type nginx knows, so the entry never matched any response and CSV bodies were served uncompressed. This changes all three templates totext/csv.Affected files:
nginx/config/agent.go,nginx/config/origin.go,nginx/config/proxy.go.nginx/config/base.goalready used the correct types, so it is unchanged.Why
Fixes #711.
The issue also asks whether CSV compression is wanted at all. I kept the entry and corrected the type, since listing it next to
text/plainandapplication/jsonshows the original intent;text/csvis the registered type for that body. If you would rather not gzip CSV, dropping the token from the three templates is a one-line-per-file change instead, and I can update this PR.Verification
grep -rn "test/csv" .returns nothing; the only remaininggzip_typeslines are the corrected ones plus the unrelated list inbase.go.go build ./nginx/...,go vet ./nginx/configpass andgofmt -l ./nginx/is clean.nginx/config, so no test changes were needed.