Skip to content

Commit 92b41eb

Browse files
committed
fix data race with errors in proxy raw
1 parent 6392cb4 commit 92b41eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

middleware/proxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ func proxyRaw(t *ProxyTarget, c echo.Context, config ProxyConfig) http.Handler {
169169

170170
errCh := make(chan error, 2)
171171
cp := func(dst io.Writer, src io.Reader) {
172-
_, err = io.Copy(dst, src)
173-
errCh <- err
172+
_, copyErr := io.Copy(dst, src)
173+
errCh <- copyErr
174174
}
175175

176176
go cp(out, in)

0 commit comments

Comments
 (0)