Skip to content

Commit

Permalink
Fix SSE streaming (#2377)
Browse files Browse the repository at this point in the history
At the moment it re-use websocket hijacking functionality

Fix #2386
  • Loading branch information
buger committed Jul 10, 2019
1 parent 3015c87 commit 211b449
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gateway/handler_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ func IsWebsocket(req *http.Request) bool {
return false
}

contentType := strings.ToLower(strings.TrimSpace(req.Header.Get("Accept")))
if contentType == "text/event-stream" {
return true
}

connection := strings.ToLower(strings.TrimSpace(req.Header.Get("Connection")))
if connection != "upgrade" {
return false
Expand Down

0 comments on commit 211b449

Please sign in to comment.