Merge v2.10 into v3.0
This commit is contained in:
commit
286181aa61
62 changed files with 712 additions and 189 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"mime"
|
||||
"net/http"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/klauspost/compress/gzhttp"
|
||||
|
@ -87,7 +88,7 @@ func (c *compress) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
|||
|
||||
// Notably for text/event-stream requests the response should not be compressed.
|
||||
// See https://github.com/traefik/traefik/issues/2576
|
||||
if contains(c.excludes, mediaType) {
|
||||
if slices.Contains(c.excludes, mediaType) {
|
||||
c.next.ServeHTTP(rw, req)
|
||||
return
|
||||
}
|
||||
|
@ -158,13 +159,3 @@ func encodingAccepts(acceptEncoding []string, typ string) bool {
|
|||
|
||||
return false
|
||||
}
|
||||
|
||||
func contains(values []string, val string) bool {
|
||||
for _, v := range values {
|
||||
if v == val {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue