Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
no gzip after on unix listen
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Jul 14, 2021
1 parent a2e63d8 commit 2c46b84
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ func (s *Server) Run(version string) error {
//gzip
h = httpmiddleware.RealIP(h)
h = httpmiddleware.Liveness(h)
gzipWrap, _ := gziphandler.NewGzipLevelAndMinSize(gzip.DefaultCompression, 1024)
h = gzipWrap(h)

// dont enable gzip handler if certantlly we are behind a web server
if !strings.HasPrefix(s.Host, "unix:") {
gzipWrap, _ := gziphandler.NewGzipLevelAndMinSize(gzip.DefaultCompression, 1024)
h = gzipWrap(h)
}

//auth
if s.Auth != "" {
user := s.Auth
Expand Down

0 comments on commit 2c46b84

Please sign in to comment.