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:
Doug Davis 2015-06-16 18:57:47 -07:00
parent fa67bab1c7
commit cff1a5ffdc
8 changed files with 9 additions and 19 deletions

View file

@ -117,10 +117,9 @@ func (ac *authChallenge) SetHeader(header http.Header) {
}
// ServeHttp handles writing the challenge response
// by setting the challenge header and status code.
// by setting the challenge header.
func (ac *authChallenge) ServeHTTP(w http.ResponseWriter, r *http.Request) {
ac.SetHeader(w.Header())
w.WriteHeader(ac.Status())
}
// accessController implements the auth.AccessController interface.