1
0
mirror of https://github.com/labstack/echo.git synced 2025-05-31 23:19:42 +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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)
} }