Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 02:15 UTC
| 1 | package caddygzip |
| 2 | |
| 3 | import ( |
| 4 | "github.com/caddyserver/caddy/v2" |
| 5 | "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode" |
| 6 | ) |
| 7 | |
| 8 | func init() { |
| 9 | caddy.RegisterModule(GzipPrecompressed{}) |
| 10 | } |
| 11 | |
| 12 | // GzipPrecompressed provides the file extension for files precompressed with gzip encoding. |
| 13 | type GzipPrecompressed struct { |
| 14 | Gzip |
| 15 | } |
| 16 | |
| 17 | // CaddyModule returns the Caddy module information. |
| 18 | func (GzipPrecompressed) CaddyModule() caddy.ModuleInfo { |
| 19 | return caddy.ModuleInfo{ |
| 20 | ID: "http.precompressed.gzip", |
| 21 | New: func() caddy.Module { return new(GzipPrecompressed) }, |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // Suffix returns the filename suffix of precompressed files. |
| 26 | func (GzipPrecompressed) Suffix() string { return ".gz" } |
| 27 | |
| 28 | var _ encode.Precompressed = (*GzipPrecompressed)(nil) |