1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 02:08:36 +00:00

Skip gzip for some well-known compressed file types (#30796)

Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
wxiaoguang
2024-05-02 10:27:25 +08:00
committed by GitHub
parent ce08a9fe2f
commit be112c1fc3
3 changed files with 42 additions and 1 deletions

View File

@@ -54,7 +54,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
const GzipMinSize = 1400 // min size to compress for the body size of response
var GzipMinSize = 1400 // min size to compress for the body size of response
// optionsCorsHandler return a http handler which sets CORS options if enabled by config, it blocks non-CORS OPTIONS requests.
func optionsCorsHandler() func(next http.Handler) http.Handler {