You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The godoc comments on net/http/httputil ReverseProxy need to be clarified. The ReverseProxy.Director function can not continue to access the provided http.Request after it returns. The code in ReverseProxy that calls the user supplied Director function will sometimes modify the Header field after Director returns, which can lead to a concurrent read/write on http.Request.Header.
My code hit a sporadic race condition due to this behavior. Director launched a goroutine to do some specialized request logging. This lead to a panic after several thousand requests.
The text was updated successfully, but these errors were encountered:
bradfitz
changed the title
net/http/httputil ReverseProxy Director comments unclear leads to potential race
net/http/httputil: ReverseProxy.Director comments unclear leads to potential race
Dec 29, 2016
The godoc comments on net/http/httputil ReverseProxy need to be clarified. The ReverseProxy.Director function can not continue to access the provided http.Request after it returns. The code in ReverseProxy that calls the user supplied Director function will sometimes modify the Header field after Director returns, which can lead to a concurrent read/write on http.Request.Header.
My code hit a sporadic race condition due to this behavior. Director launched a goroutine to do some specialized request logging. This lead to a panic after several thousand requests.
The text was updated successfully, but these errors were encountered: