registry: add a critical section to protect authTransport.modReq

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
This commit is contained in:
lzhfromustc 2019-10-27 19:57:15 -04:00 committed by Ziheng Liu
parent a09e6e323e
commit 49fbb9c985

View file

@ -133,7 +133,9 @@ func (tr *authTransport) RoundTrip(orig *http.Request) (*http.Response, error) {
}
resp, err := tr.RoundTripper.RoundTrip(req)
if err != nil {
tr.mu.Lock()
delete(tr.modReq, orig)
tr.mu.Unlock()
return nil, err
}
if len(resp.Header["X-Docker-Token"]) > 0 {