1
0
mirror of https://github.com/labstack/echo.git synced 2025-06-15 00:14:57 +02:00

proxy middleware should use http proxy for SSE requests (#2624)

This commit is contained in:
Martti T
2024-04-15 21:12:26 +03:00
committed by GitHub
parent 3062025405
commit e0f2a02e4c

View File

@ -366,8 +366,7 @@ func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc {
switch { switch {
case c.IsWebSocket(): case c.IsWebSocket():
proxyRaw(tgt, c).ServeHTTP(res, req) proxyRaw(tgt, c).ServeHTTP(res, req)
case req.Header.Get(echo.HeaderAccept) == "text/event-stream": default: // even SSE requests
default:
proxyHTTP(tgt, c, config).ServeHTTP(res, req) proxyHTTP(tgt, c, config).ServeHTTP(res, req)
} }