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

Content-Encoding header is not being properly parsed #959

Open
mmukahhal-tibco opened this issue Nov 22, 2024 · 0 comments · May be fixed by #960
Open

Content-Encoding header is not being properly parsed #959

mmukahhal-tibco opened this issue Nov 22, 2024 · 0 comments · May be fixed by #960

Comments

@mmukahhal-tibco
Copy link

Content encodings can be supplied by multiple Content-Encoding headers or by one header with a comma separated list of encodings as seen here.

The Header map embedded in an http.Request from the Go standard library states that:

Header contains the request header fields either received by the server or to be sent by the client.

If a server received a request with header lines,

Host: example.com
accept-encoding: gzip, deflate
Accept-Language: en-us
fOO: Bar
foo: two
then

Header = map[string][]string{
    "Accept-Encoding": {"gzip, deflate"},
    "Accept-Language": {"en-us"},
    "Foo": {"Bar", "two"},
}

As seen by the Accept-Encoding header, this means a comma separated list of values will be returned as a []string with a single element.

Currently, chi does not make this distinction, and so it is not properly parsing the Content-Encoding header.

I will submit a PR fixing this issue shortly.

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 a pull request may close this issue.

1 participant