Skip to content

Commit 16e7651

Browse files
committed
ociregistry/ociauth: pass context to token GET requests
Although POST requests to the token server were correctly being passed the context, GET requests were not. Remedy that by using `NewRequestWithContext` instead of `NewRequest`. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I7084253af14dd9b57e92aea86bc161d6a3aceb49 Reviewed-on: https://review.gerrithub.io/c/cue-labs/oci/+/1184461 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUE porcuepine <[email protected]>
1 parent 39d12ee commit 16e7651

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: ociregistry/ociauth/auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ func (r *registry) acquireToken(ctx context.Context, scope Scope) (*wireToken, e
397397
v.Set("service", service)
398398
}
399399
u.RawQuery = v.Encode()
400-
req, err := http.NewRequest("GET", u.String(), nil)
400+
req, err := http.NewRequestWithContext(ctx, "GET", u.String(), nil)
401401
if err != nil {
402402
return nil, err
403403
}

0 commit comments

Comments
 (0)