mirror of
https://github.com/grafana/grafana.git
synced 2026-05-04 17:26:21 -04:00
This PR adds /api/gnet to the list of ignored paths in the gzip middleware.
Without this, when gzip is enabled (`server.enable_gzip = true`), responses
from the gnet proxy are double compressed: once by grafana.com and once by
Grafana itself. With this change we only do one round of compression for these
endpoints.
To test this out, try a request like this with `server.enable_gzip = true`
(after setting `GCOM_TOKEN` to a valid grafana.com token; you may need to
change the 'bsull' slug, too):
curl -v --user admin:admin \
-H "X-Api-Key: $GCOM_TOKEN" \
-H 'Accept-Encoding: gzip' \
localhost:3000/api/gnet/instances/bsull/provisioned-plugins/grafana-ml-app | gzip -d
Note that there are two Content-Encoding: gzip headers before this PR, and
the output is still compressed even after the `gzip -d`. After this PR things
look as expected.
|
||
|---|---|---|
| .. | ||
| cookies | ||
| csrf | ||
| loggermw | ||
| auth.go | ||
| auth_test.go | ||
| csp.go | ||
| dashboard_redirect.go | ||
| dashboard_redirect_test.go | ||
| gziper.go | ||
| middleware.go | ||
| middleware_basic_auth_test.go | ||
| middleware_jwt_auth_test.go | ||
| middleware_test.go | ||
| org_redirect.go | ||
| org_redirect_test.go | ||
| quota.go | ||
| quota_test.go | ||
| recovery.go | ||
| recovery_test.go | ||
| request_metrics.go | ||
| request_test.go | ||
| request_tracing.go | ||
| subpath_redirect.go | ||
| subpath_redirect_test.go | ||
| testing.go | ||
| validate_host.go | ||