mirror of
https://github.com/golang/go
synced 2024-11-17 05:54:46 -07:00
separate condition
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
parent
c817183043
commit
efc019a9fe
@ -402,11 +402,15 @@ func (p *ReverseProxy) flushInterval(res *http.Response) time.Duration {
|
||||
|
||||
// For Server-Sent Events responses, flush immediately.
|
||||
// The MIME type is defined in https://www.w3.org/TR/eventsource/#text-event-stream
|
||||
// We might have the case of streaming for which Content-Length might be unset.
|
||||
if resCT == "text/event-stream" || res.ContentLength == -1 {
|
||||
if resCT == "text/event-stream" {
|
||||
return -1 // negative means immediately
|
||||
}
|
||||
|
||||
// We might have the case of streaming for which Content-Length might be unset.
|
||||
if res.ContentLength == -1 {
|
||||
return -1
|
||||
}
|
||||
|
||||
return p.FlushInterval
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user