Commit d1a7eb5d authored by Georges-Etienne Legendre's avatar Georges-Etienne Legendre Committed by Nick Thomas

Disable compression for openHttpArchive

parent 10f23d51
---
title: Disable compression for open archive
merge_request: 508
author: Georges-Etienne Legendre
type: fixed
......@@ -29,6 +29,7 @@ var httpClient = &http.Client{
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 10 * time.Second,
ResponseHeaderTimeout: 30 * time.Second,
DisableCompression: true,
})),
}
......
......@@ -53,3 +53,16 @@ func TestOpenHTTPArchive(t *testing.T) {
require.NoError(t, err, "read zip entry contents")
require.Equal(t, contents, string(actualContents), "compare zip entry contents")
}
func TestOpenHTTPArchiveNotSendingAcceptEncodingHeader(t *testing.T) {
requestHandler := func(w http.ResponseWriter, r *http.Request) {
require.Equal(t, "GET", r.Method)
require.Nil(t, r.Header["Accept-Encoding"])
w.WriteHeader(http.StatusOK)
}
srv := httptest.NewServer(http.HandlerFunc(requestHandler))
defer srv.Close()
OpenArchive(context.Background(), srv.URL)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment