Skip to content

Commit

Permalink
gzip workaround: Accept-Encoding: identitiy
Browse files Browse the repository at this point in the history
  • Loading branch information
1cedsoda committed Feb 20, 2024
1 parent 1b1bc0e commit 04f8e48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func (h *PluginHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
buffer: &bytes.Buffer{},
ResponseWriter: rw,
}
myrw.Header().Set("Accept-Encoding", "identity")
h.next.ServeHTTP(myrw, req)

if myrw.Header().Get("Content-Type") == "text/html" {
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ experimental:
plugins:
traefik-umami-plugin:
moduleName: "github.com/1cedsoda/traefik-umami-plugin"
version: "v1.0.1"
version: "v1.0.2"
```
```toml
[experimental.plugins.traefik-umami-plugin]
moduleName = "github.com/1cedsoda/traefik-umami-plugin"
version = "v1.0.1"
version = "v1.0.2"
```
With the plugin installed, you can configure a middleware in a dynamic configuration such as a `config.yml` or docker labels.
Inside `traefik-umami-plugin` the plugin can be configured.
Expand Down
2 changes: 1 addition & 1 deletion umami_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func downloadScript(config *Config, ctx context.Context) (string, error) {
}
req.Header.Set("User-Agent", "traefik-umami-plugin")
req.Header.Set("Accept", "application/javascript")
req.Header.Set("Accept-Encoding", "utf-8")
req.Header.Set("Accept-Encoding", "identity")

// make request
client := &http.Client{}
Expand Down

0 comments on commit 04f8e48

Please sign in to comment.