Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Proxy incorrectly relays compressed body #428

@jgilbert2017

Description

@jgilbert2017

I'm testing via wget --no-check-certificate -e use_proxy=yes -e http_proxy=127.0.0.1:8000 http://www.google.com.

The request header includes Accept-Encoding: identity which is to say the client can't (or won't) process any encoding transformation.

Code in RequestHandler adds gzip and deflate encodings on the request, but the proxy does not seem to decode the body before passing it back to the client. As a result, wget saves the compressed contents rather than the html as we'd want.

        private void PrepareRequestHeaders(HeaderCollection requestHeaders)
        {
            if (requestHeaders.HeaderExists(KnownHeaders.AcceptEncoding))
            {
                requestHeaders.SetOrAddHeaderValue(KnownHeaders.AcceptEncoding, "gzip,deflate");
            }

            requestHeaders.FixProxyHeaders();
        }

I don't quite understand why this code exists.

Interested in what you guys think the proper fix is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions