Browse Source

Merge pull request #171 from stellar/allow-streaming-tests

Add `flushWriter` to `mutil.WrapWriter()`
Carl Jackson 10 years ago
parent
commit
bf843a174a
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      web/mutil/writer_proxy.go

+ 14
- 0
web/mutil/writer_proxy.go View File

@ -39,6 +39,9 @@ func WrapWriter(w http.ResponseWriter) WriterProxy {
if cn && fl && hj && rf {
return &fancyWriter{bw}
}
if fl {
return &flushWriter{bw}
}
return &bw
}
@ -123,3 +126,14 @@ var _ http.CloseNotifier = &fancyWriter{}
var _ http.Flusher = &fancyWriter{}
var _ http.Hijacker = &fancyWriter{}
var _ io.ReaderFrom = &fancyWriter{}
type flushWriter struct {
basicWriter
}
func (f *flushWriter) Flush() {
fl := f.basicWriter.ResponseWriter.(http.Flusher)
fl.Flush()
}
var _ http.Flusher = &flushWriter{}

Loading…
Cancel
Save