aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/router.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/router.go b/app/router.go
index 5730ab0..9296de2 100644
--- a/app/router.go
+++ b/app/router.go
@@ -6,6 +6,8 @@ import (
"io"
"net"
"regexp"
+ "slices"
+ "strings"
)
type Router struct {
@@ -25,7 +27,7 @@ func (r *Router) handler(request *Request) func(*Request) *Response {
}
func (r *Router) write(writer io.Writer, response *Response, request *Request) (err error) {
- if request.Header("Accept-Encoding") == "gzip" {
+ if slices.Contains(strings.Split(request.Header("Accept-Encoding"), ", "), "gzip") {
response.headers["Content-Encoding"] = "gzip"
}