summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/encode/brotli
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/brotli
parentd5ae3a4966288475025360f43917e9fae94148d7 (diff)
Fix encoder name bug; remove unused field in encode middleware struct
Diffstat (limited to 'modules/caddyhttp/encode/brotli')
-rw-r--r--modules/caddyhttp/encode/brotli/brotli.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/caddyhttp/encode/brotli/brotli.go b/modules/caddyhttp/encode/brotli/brotli.go
index 6bfd11f..dc4559e 100644
--- a/modules/caddyhttp/encode/brotli/brotli.go
+++ b/modules/caddyhttp/encode/brotli/brotli.go
@@ -35,6 +35,10 @@ func (b Brotli) Validate() error {
return nil
}
+// AcceptEncoding returns the name of the encoding as
+// used in the Accept-Encoding request headers.
+func (Brotli) AcceptEncoding() string { return "br" }
+
// NewEncoder returns a new brotli writer.
func (b Brotli) NewEncoder() encode.Encoder {
quality := brotli.DefaultCompression
@@ -46,6 +50,6 @@ func (b Brotli) NewEncoder() encode.Encoder {
// Interface guards
var (
- _ encode.Encoding = (*Brotli)(nil)
+ _ encode.Encoding = (*Brotli)(nil)
_ caddy.Validator = (*Brotli)(nil)
)