1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-29 22:48:07 +02:00

proxy middleware: reuse echo request context (#2537)

This commit is contained in:
Kai Ratzeburg
2023-11-05 17:01:01 +01:00
committed by GitHub
parent 69a0de8415
commit c7d6d4373f
2 changed files with 64 additions and 0 deletions

View File

@@ -359,6 +359,10 @@ func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc {
c.Set("_error", nil)
}
// This is needed for ProxyConfig.ModifyResponse and/or ProxyConfig.Transport to be able to process the Request
// that Balancer may have replaced with c.SetRequest.
req = c.Request()
// Proxy
switch {
case c.IsWebSocket():