Make responseWriter a CloseNotifier

This is a temporary no-op that returns a new channel;
eventually it'd be nice if this worked for real.
This commit is contained in:
Matt Holt
2017-05-02 00:13:14 -06:00
committed by GitHub
parent 97ccb08f94
commit 65923b35f5

View File

@@ -83,9 +83,15 @@ func (w *responseWriter) Write(p []byte) (int, error) {
func (w *responseWriter) Flush() {}
// TODO: Implement a functional CloseNotify method.
func (w *responseWriter) CloseNotify() <-chan bool { return make(<-chan bool) }
// test that we implement http.Flusher
var _ http.Flusher = &responseWriter{}
// test that we implement http.CloseNotifier
var _ http.CloseNotifier = &responseWriter{}
// copied from http2/http2.go
// bodyAllowedForStatus reports whether a given response status code
// permits a body. See RFC 2616, section 4.4.