summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/encode/gzip
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/encode/gzip')
-rw-r--r--modules/caddyhttp/encode/gzip/gzip_precompressed.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/caddyhttp/encode/gzip/gzip_precompressed.go b/modules/caddyhttp/encode/gzip/gzip_precompressed.go
new file mode 100644
index 0000000..7103cc8
--- /dev/null
+++ b/modules/caddyhttp/encode/gzip/gzip_precompressed.go
@@ -0,0 +1,28 @@
+package caddygzip
+
+import (
+ "github.com/caddyserver/caddy/v2"
+ "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode"
+)
+
+func init() {
+ caddy.RegisterModule(GzipPrecompressed{})
+}
+
+// GzipPrecompressed provides the file extension for files precompressed with gzip encoding.
+type GzipPrecompressed struct {
+ Gzip
+}
+
+// CaddyModule returns the Caddy module information.
+func (GzipPrecompressed) CaddyModule() caddy.ModuleInfo {
+ return caddy.ModuleInfo{
+ ID: "http.precompressed.gzip",
+ New: func() caddy.Module { return new(GzipPrecompressed) },
+ }
+}
+
+// Suffix returns the filename suffix of precompressed files.
+func (GzipPrecompressed) Suffix() string { return ".gz" }
+
+var _ encode.Precompressed = (*GzipPrecompressed)(nil)