Skip to content

Commit

Permalink
huge derp, forgot to actually test in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffoo committed Jan 25, 2013
1 parent 7cdc2fb commit bfcdaa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func defaultFailure() (Status, Headers, Body) {
return 403, Headers{"Content-Type": []string{"text/html"}}, Body("Access Denied.") // default failure page
return 401, Headers{"WWW-Authenticate": []string{"Basic realm=\"Basic\""}, "Content-Type": []string{"text/html"}}, Body("Access Denied.") // default failure page
}

func BasicAuth(auth func(string, string, Request, error) bool, failure func(Env) (Status, Headers, Body)) Middleware {
Expand Down
3 changes: 2 additions & 1 deletion basic_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ func TestFailByDefault(t *testing.T) {
t.Error(err)
}

if status != 403 {
// TODO test header
if status != 401 {
t.Error("Request did not succeed, expected status 403, got:", status)
}
}

0 comments on commit bfcdaa0

Please sign in to comment.