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 447c92d commit f62a7ee
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 f62a7ee

Please sign in to comment.