Skip to content

Commit

Permalink
proxy middleware should use raw http proxy for SSE requests
Browse files Browse the repository at this point in the history
  • Loading branch information
aldas committed Apr 15, 2024
1 parent 3062025 commit c134df4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions middleware/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,8 @@ func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc {

// Proxy
switch {
case c.IsWebSocket():
case c.IsWebSocket(), req.Header.Get(echo.HeaderAccept) == "text/event-stream":
proxyRaw(tgt, c).ServeHTTP(res, req)
case req.Header.Get(echo.HeaderAccept) == "text/event-stream":
default:
proxyHTTP(tgt, c, config).ServeHTTP(res, req)
}
Expand Down

0 comments on commit c134df4

Please sign in to comment.