forked from TrueCloudLab/distribution
Move challenge http status code logic
See: d796729b6b/registry/handlers/app.go (L498)
Per the comment on line 498, this moves the logic of setting the http
status code into the serveJSON func, leaving the auth.Challenge.ServeHTTP()
func to just set the auth challenge header.
Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
fa67bab1c7
commit
cff1a5ffdc
8 changed files with 9 additions and 19 deletions
|
@ -49,6 +49,7 @@ func TestBasicAccessController(t *testing.T) {
|
|||
switch err := err.(type) {
|
||||
case auth.Challenge:
|
||||
err.ServeHTTP(w, r)
|
||||
w.WriteHeader(http.StatusUnauthorized)
|
||||
return
|
||||
default:
|
||||
t.Fatalf("unexpected error authorizing request: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue