summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/encode/gzip
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-06-29 16:57:55 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-06-29 16:57:55 -0600
commitfee0b38b4842403a28d664385a1ff1075e8891d2 (patch)
treeab2561988c411e26155f742f3cb38d12461f1d42 /modules/caddyhttp/encode/gzip
parentd5ae3a4966288475025360f43917e9fae94148d7 (diff)
Fix encoder name bug; remove unused field in encode middleware struct
Diffstat (limited to 'modules/caddyhttp/encode/gzip')
-rw-r--r--modules/caddyhttp/encode/gzip/gzip.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/caddyhttp/encode/gzip/gzip.go b/modules/caddyhttp/encode/gzip/gzip.go
index 156eb0d..f8e16c9 100644
--- a/modules/caddyhttp/encode/gzip/gzip.go
+++ b/modules/caddyhttp/encode/gzip/gzip.go
@@ -40,6 +40,10 @@ func (g Gzip) Validate() error {
return nil
}
+// AcceptEncoding returns the name of the encoding as
+// used in the Accept-Encoding request headers.
+func (Gzip) AcceptEncoding() string { return "gzip" }
+
// NewEncoder returns a new gzip writer.
func (g Gzip) NewEncoder() encode.Encoder {
writer, _ := gzip.NewWriterLevel(nil, g.Level)
@@ -51,7 +55,7 @@ var defaultGzipLevel = 5
// Interface guards
var (
- _ encode.Encoding = (*Gzip)(nil)
+ _ encode.Encoding = (*Gzip)(nil)
_ caddy.Provisioner = (*Gzip)(nil)
_ caddy.Validator = (*Gzip)(nil)
)