diff options
Diffstat (limited to 'libgo/go/net/http/server.go')
-rw-r--r-- | libgo/go/net/http/server.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgo/go/net/http/server.go b/libgo/go/net/http/server.go index bad3bcb2896..288539ba576 100644 --- a/libgo/go/net/http/server.go +++ b/libgo/go/net/http/server.go @@ -341,7 +341,7 @@ func (w *response) WriteHeader(code int) { } } else { // If no content type, apply sniffing algorithm to body. - if w.header.Get("Content-Type") == "" { + if w.header.Get("Content-Type") == "" && w.req.Method != "HEAD" { w.needSniff = true } } @@ -1078,8 +1078,8 @@ func ListenAndServeTLS(addr string, certFile string, keyFile string, handler Han // of the server's certificate followed by the CA's certificate. // // If srv.Addr is blank, ":https" is used. -func (s *Server) ListenAndServeTLS(certFile, keyFile string) error { - addr := s.Addr +func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error { + addr := srv.Addr if addr == "" { addr = ":https" } @@ -1101,7 +1101,7 @@ func (s *Server) ListenAndServeTLS(certFile, keyFile string) error { } tlsListener := tls.NewListener(conn, config) - return s.Serve(tlsListener) + return srv.Serve(tlsListener) } // TimeoutHandler returns a Handler that runs h with the given time limit. |