Skip to content

Commit

Permalink
Fix don't gzip server-sent events (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbug authored Dec 12, 2021
1 parent 51dd498 commit d34904d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (g *gzipHandler) Handle(c *gin.Context) {
func (g *gzipHandler) shouldCompress(req *http.Request) bool {
if !strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") ||
strings.Contains(req.Header.Get("Connection"), "Upgrade") ||
strings.Contains(req.Header.Get("Content-Type"), "text/event-stream") {
strings.Contains(req.Header.Get("Accept"), "text/event-stream") {

return false
}
Expand Down

0 comments on commit d34904d

Please sign in to comment.