Skip to content

Commit 79e888f

Browse files
committed
refactor: refactor codebase to improve maintainability and performance
- Replace hardcoded "Accept-Encoding" header string with a constant `headerAcceptEncoding` Signed-off-by: appleboy <[email protected]>
1 parent 262eca6 commit 79e888f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (g *gzipHandler) Handle(c *gin.Context) {
9999
}
100100

101101
func (g *gzipHandler) shouldCompress(req *http.Request) bool {
102-
if !strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") ||
102+
if !strings.Contains(req.Header.Get(headerAcceptEncoding), "gzip") ||
103103
strings.Contains(req.Header.Get("Connection"), "Upgrade") {
104104
return false
105105
}

0 commit comments

Comments
 (0)