Closed juliens closed 6 years ago
Hi there, @juliens!
Do you have a specific use case that requires this? We’ve discussed the CloseNotifier interface before here: https://github.com/NYTimes/gziphandler/pull/10
Hi,
I use it with https://golang.org/pkg/net/http/httputil/#NewSingleHostReverseProxy. The fact that GzipWriter doesn't implement CloseNotify break the chain, If I have a long connection and if the client break the connection, the server connection is not close correctly.
Sorry for the delay. After reading the docs, it looks like things have changed a bit since the discussion in #10 so I'm fine with this coming in.
Would you mind adding a test for your changes?
Done 😄
Thanks! 🌯 🎆
GzipResponseWriter doesn't implement CloseNotifier.
We test if the underlying ResponseWriter implement it and if it does, we use it. If it doesn't, we do not implement it in order to leave the management of the problem to the user.