Skip to content

Commit bfcdaa0

Browse files
committed
huge derp, forgot to actually test in browser
1 parent 7cdc2fb commit bfcdaa0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

basic_auth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

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

1313
func BasicAuth(auth func(string, string, Request, error) bool, failure func(Env) (Status, Headers, Body)) Middleware {

basic_auth_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ func TestFailByDefault(t *testing.T) {
8080
t.Error(err)
8181
}
8282

83-
if status != 403 {
83+
// TODO test header
84+
if status != 401 {
8485
t.Error("Request did not succeed, expected status 403, got:", status)
8586
}
8687
}

0 commit comments

Comments
 (0)