mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
32 lines
933 B
Go
32 lines
933 B
Go
|
package caddybrotli
|
||
|
|
||
|
import (
|
||
|
"github.com/caddyserver/caddy/v2"
|
||
|
"github.com/caddyserver/caddy/v2/modules/caddyhttp/encode"
|
||
|
)
|
||
|
|
||
|
func init() {
|
||
|
caddy.RegisterModule(BrotliPrecompressed{})
|
||
|
}
|
||
|
|
||
|
// BrotliPrecompressed provides the file extension for files precompressed with brotli encoding.
|
||
|
type BrotliPrecompressed struct{}
|
||
|
|
||
|
// CaddyModule returns the Caddy module information.
|
||
|
func (BrotliPrecompressed) CaddyModule() caddy.ModuleInfo {
|
||
|
return caddy.ModuleInfo{
|
||
|
ID: "http.precompressed.br",
|
||
|
New: func() caddy.Module { return new(BrotliPrecompressed) },
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// AcceptEncoding returns the name of the encoding as
|
||
|
// used in the Accept-Encoding request headers.
|
||
|
func (BrotliPrecompressed) AcceptEncoding() string { return "br" }
|
||
|
|
||
|
// Suffix returns the filename suffix of precompressed files.
|
||
|
func (BrotliPrecompressed) Suffix() string { return ".br" }
|
||
|
|
||
|
// Interface guards
|
||
|
var _ encode.Precompressed = (*BrotliPrecompressed)(nil)
|