-
Notifications
You must be signed in to change notification settings - Fork 270
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
CompressHandler gzip's twice #153
Comments
A repository with the minimal working example and instructions on how to reproduce it can be found here: https://github.com/spreadshirt/gorilla-handlers-double-gzip-bug |
Happy to take a PR that prevents this.
…On Thu, Apr 4, 2019 at 6:55 AM Andreas Linz ***@***.***> wrote:
The CompressHandler of [gorilla/handlers][1] gzips responses twice if
they're already gzipped, i.e. it ignores the Content-Encoding header.
Here's a minimal working example:
package main
import (
"fmt"
"net/http"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
r := mux.NewRouter()
r.Handle("/", promhttp.Handler())
r.Use(handlers.CompressHandler)
fmt.Println("Listening on :9999")
http.ListenAndServe(":9999", r)
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#153>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABIcF8ZpnHP6LjZVU4Ate-Gl5AgP1sFks5vdgRZgaJpZM4cc3Yb>
.
|
I'm on it. |
This prevents following handlers from encoding the request again since we dropped the intention to do this. Fixes gorilla#153
Please see PR #157 for a fix. |
This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days. |
This message is to keep the issue from being closed automatically. |
* Verify that supported Accept-Encoding header are dropped * Drop accept-encoding header when supported This prevents following handlers from encoding the request again since we dropped the intention to do this. Fixes #153 * Do not use subtests to be compatible with Go <1.7
The
CompressHandler
of [gorilla/handlers][1] gzips responses twice if they're already gzipped, i.e. it ignores theContent-Encoding
header.Here's a minimal working example:
The text was updated successfully, but these errors were encountered: