Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
Signed-off-by: David Wu <david.wu@docker.com>
  • Loading branch information
David Wu committed Sep 20, 2018
1 parent f730f3a commit b2bd465
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contrib/token-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (ts *tokenServer) getToken(ctx context.Context, w http.ResponseWriter, r *h
// Get response context.
ctx, w = dcontext.WithResponseWriter(ctx, w)

challenge.SetHeaders(w)
challenge.SetHeaders(r, w)
handleError(ctx, errcode.ErrorCodeUnauthorized.WithDetail(challenge.Error()), w)

dcontext.GetResponseLogger(ctx).Info("get token authentication challenge")
Expand Down
2 changes: 1 addition & 1 deletion registry/auth/htpasswd/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestBasicAccessController(t *testing.T) {
if err != nil {
switch err := err.(type) {
case auth.Challenge:
err.SetHeaders(w)
err.SetHeaders(r, w)
w.WriteHeader(http.StatusUnauthorized)
return
default:
Expand Down
2 changes: 1 addition & 1 deletion registry/auth/silly/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestSillyAccessController(t *testing.T) {
if err != nil {
switch err := err.(type) {
case auth.Challenge:
err.SetHeaders(w)
err.SetHeaders(r, w)
w.WriteHeader(http.StatusUnauthorized)
return
default:
Expand Down

0 comments on commit b2bd465

Please sign in to comment.