ServeHTTP adds compression to the original http.Handler's ServeHTTP() method.
(writer http.ResponseWriter, req *http.Request)
| 84 | |
| 85 | // ServeHTTP adds compression to the original http.Handler's ServeHTTP() method. |
| 86 | func (c CompressionHandler) ServeHTTP(writer http.ResponseWriter, req *http.Request) { |
| 87 | compWriter := newCompressedResponseWriter(writer, req) |
| 88 | c.Handler.ServeHTTP(compWriter, req) |
| 89 | compWriter.Close() |
| 90 | } |