grafana/pkg/middleware
Ben Sully 51c94bccd7
api: ignore /api/gnet proxy when gzipping responses (#71437)
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.
2023-07-13 07:51:25 +01:00
..
cookies Auth: Add feature flag to move token rotation to client (#65060) 2023-03-23 14:39:04 +01:00
csrf CSRF middleware: Add flag to skip login cookie check (#66806) 2023-04-24 10:11:08 -03:00
loggermw Instrumentation: Add support for instrumenting database queries (#66022) 2023-04-28 15:19:06 +02:00
auth_test.go Chore: Move ReqContext to contexthandler service (#62102) 2023-01-27 08:50:36 +01:00
auth.go Auth: Add empty role definition (#64694) 2023-07-06 15:40:06 +02:00
csp.go Feature: Trusted Types support (#64975) 2023-04-27 18:20:37 +02:00
dashboard_redirect_test.go Chore: Remove endpoints that contain the slug field (#35104) 2021-06-03 16:20:13 +03:00
dashboard_redirect.go Chore: Move ReqContext to contexthandler service (#62102) 2023-01-27 08:50:36 +01:00
gziper.go api: ignore /api/gnet proxy when gzipping responses (#71437) 2023-07-13 07:51:25 +01:00
middleware_basic_auth_test.go LDAP: Move LDAP globals to Config (#63255) 2023-02-10 19:01:55 +01:00
middleware_jwt_auth_test.go ContextHandler: add all configured auth header to context (#62775) 2023-02-02 16:25:46 +01:00
middleware_test.go Auth: Fix orgrole picker disabled if isSynced user (#64033) 2023-03-22 17:41:59 +00:00
middleware.go Dashboards: Add dashboard embed route (#69596) 2023-07-06 17:43:20 +03:00
org_redirect_test.go Auth: Refactor auth package (#58920) 2022-11-18 09:56:06 +01:00
org_redirect.go UserService: use the UserService instead of calling sqlstore directly (#55745) 2022-09-27 07:58:49 -04:00
quota_test.go Auth: Refactor auth package (#58920) 2022-11-18 09:56:06 +01:00
quota.go Chore: Move ReqContext to contexthandler service (#62102) 2023-01-27 08:50:36 +01:00
recovery_test.go Config: Add configuration option to define custom user-facing general error message for certain error types (#70023) 2023-06-16 10:46:47 -05:00
recovery.go Config: Add configuration option to define custom user-facing general error message for certain error types (#70023) 2023-06-16 10:46:47 -05:00
request_metrics.go Logger: Add feature toggle for errors in HTTP request logs (#64425) 2023-03-31 15:38:09 +02:00
request_test.go Logger: Add feature toggle for errors in HTTP request logs (#64425) 2023-03-31 15:38:09 +02:00
request_tracing.go Logger: Add feature toggle for errors in HTTP request logs (#64425) 2023-03-31 15:38:09 +02:00
subpath_redirect_test.go ServeFromSubPath: Redirect to URL with subpath when subpath missing (#66724) 2023-04-24 09:55:55 +02:00
subpath_redirect.go ServeFromSubPath: Redirect to URL with subpath when subpath missing (#66724) 2023-04-24 09:55:55 +02:00
testing.go ServeFromSubPath: Redirect to URL with subpath when subpath missing (#66724) 2023-04-24 09:55:55 +02:00
validate_host.go Chore: Move ReqContext to contexthandler service (#62102) 2023-01-27 08:50:36 +01:00