1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

update some dependencies (#208)

* update some dependencies

* some more

* add these

* remove things?

* regen
This commit is contained in:
Craig Peterson
2017-09-18 15:35:10 -04:00
committed by GitHub
parent ae14b0e790
commit e4ad084494
141 changed files with 3816 additions and 15671 deletions

View File

@ -231,6 +231,12 @@ type minifyResponseWriter struct {
mediatype string
}
// WriteHeader intercepts any header writes and removes the Content-Length header.
func (w *minifyResponseWriter) WriteHeader(status int) {
w.ResponseWriter.Header().Del("Content-Length")
w.ResponseWriter.WriteHeader(status)
}
// Write intercepts any writes to the response writer.
// The first write will extract the Content-Type as the mediatype. Otherwise it falls back to the RequestURI extension.
func (w *minifyResponseWriter) Write(b []byte) (int, error) {
@ -266,7 +272,8 @@ func (m *M) ResponseWriter(w http.ResponseWriter, r *http.Request) *minifyRespon
func (m *M) Middleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
mw := m.ResponseWriter(w, r)
defer mw.Close()
next.ServeHTTP(mw, r)
mw.Close()
})
}