mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
Disable setting Accept-Encoding: gzip
unless explicitly set
This commit is contained in:
@ -61,7 +61,25 @@ func NewProxy(cfg Config) (*Proxy, error) {
|
||||
p.logger = log.NewNopLogger()
|
||||
}
|
||||
|
||||
transport := &http.Transport{
|
||||
// Values taken from `http.DefaultTransport`.
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 30 * time.Second,
|
||||
KeepAlive: 30 * time.Second,
|
||||
}).DialContext,
|
||||
ForceAttemptHTTP2: true,
|
||||
MaxIdleConns: 100,
|
||||
IdleConnTimeout: 90 * time.Second,
|
||||
TLSHandshakeTimeout: 10 * time.Second,
|
||||
ExpectContinueTimeout: 1 * time.Second,
|
||||
|
||||
// Non-default transport values.
|
||||
DisableCompression: true,
|
||||
}
|
||||
|
||||
p.handler = &httputil.ReverseProxy{
|
||||
Transport: transport,
|
||||
Director: p.modifyRequest,
|
||||
ModifyResponse: p.modifyResponse,
|
||||
ErrorHandler: p.errorHandler,
|
||||
|
Reference in New Issue
Block a user