Skip to content

fix(nginx): use text/csv in gzip_types instead of test/csv - #714

Open
gu-feng418 wants to merge 1 commit into
uber:masterfrom
gu-feng418:fix/nginx-gzip-text-csv
Open

gu-feng418 wants to merge 1 commit into
uber:masterfrom
gu-feng418:fix/nginx-gzip-text-csv

Conversation

@gu-feng418

Copy link
Copy Markdown
Contributor

What this does

gzip_types in the agent, origin and proxy nginx templates listed test/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 to text/csv.

gzip_types text/plain test/csv application/json;   ->   gzip_types text/plain text/csv application/json;

Affected files: nginx/config/agent.go, nginx/config/origin.go, nginx/config/proxy.go. nginx/config/base.go already 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/plain and application/json shows the original intent; text/csv is 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 remaining gzip_types lines are the corrected ones plus the unrelated list in base.go.
  • go build ./nginx/..., go vet ./nginx/config pass and gofmt -l ./nginx/ is clean.
  • The strings are plain template constants with no unit tests in nginx/config, so no test changes were needed.

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.
@CLAassistant

CLAassistant commented Oct 8, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nginx gzip_types uses test/csv rather than text/csv

2 participants