MCPcopy
hub / github.com/caddyserver/caddy / isEncodeAllowed

Function isEncodeAllowed

modules/caddyhttp/encode/encode.go:158–160  ·  view source on GitHub ↗
(h http.Header)

Source from the content-addressed store, hash-verified

156}
157
158func isEncodeAllowed(h http.Header) bool {
159 return !strings.Contains(h.Get("Cache-Control"), "no-transform")
160}
161
162func (enc *Encode) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error {
163 if isEncodeAllowed(r.Header) {

Callers 3

TestIsEncodeAllowedFunction · 0.85
ServeHTTPMethod · 0.85
initMethod · 0.85

Calls 1

GetMethod · 0.65

Tested by 1

TestIsEncodeAllowedFunction · 0.68