Skip to content

Commit d34904d

Browse files
authored
Fix don't gzip server-sent events (#31)
1 parent 51dd498 commit d34904d

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
@@ -63,7 +63,7 @@ func (g *gzipHandler) Handle(c *gin.Context) {
6363
func (g *gzipHandler) shouldCompress(req *http.Request) bool {
6464
if !strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") ||
6565
strings.Contains(req.Header.Get("Connection"), "Upgrade") ||
66-
strings.Contains(req.Header.Get("Content-Type"), "text/event-stream") {
66+
strings.Contains(req.Header.Get("Accept"), "text/event-stream") {
6767

6868
return false
6969
}

0 commit comments

Comments
 (0)