mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Merge branch 'master' of https://github.com/mholt/caddy
This commit is contained in:
commit
dbef6c73bc
3 changed files with 6 additions and 2 deletions
|
@ -33,7 +33,9 @@ func (g Gzip) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
|
|||
return g.Next.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
r.Header.Del("Accept-Encoding") // Removes header to prevent double encoding by ambitious fastcgi implementations
|
||||
// Delete this header so gzipping isn't repeated later in the chain
|
||||
r.Header.Del("Accept-Encoding")
|
||||
|
||||
w.Header().Set("Content-Encoding", "gzip")
|
||||
gzipWriter := gzip.NewWriter(w)
|
||||
defer gzipWriter.Close()
|
||||
|
|
|
@ -130,5 +130,5 @@ var (
|
|||
|
||||
const (
|
||||
envGatewayInterface = "caddy-CGI/1.1"
|
||||
envServerSoftware = "caddy/?.?.?" // TODO
|
||||
envServerSoftware = "caddy/" // TODO: Version
|
||||
)
|
||||
|
|
|
@ -162,6 +162,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if vh, ok := s.vhosts[host]; ok {
|
||||
w.Header().Set("Server", "Caddy")
|
||||
|
||||
status, _ := vh.stack.ServeHTTP(w, r)
|
||||
|
||||
// Fallback error response in case error handling wasn't chained in
|
||||
|
|
Loading…
Reference in a new issue