From 198a4f56be9fe77392e3ba552f9fc4ea7b1cf0e9 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 26 Aug 2017 17:51:18 +0800 Subject: [PATCH] update Signed-off-by: Bo-Yi Wu --- auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth.go b/auth.go index e7c46bf6..85d96fd3 100644 --- a/auth.go +++ b/auth.go @@ -47,7 +47,7 @@ func BasicAuthForRealm(accounts Accounts, realm string) HandlerFunc { pairs := processAccounts(accounts) return func(c *Context) { // Search user in the slice of allowed credentials - user, found := pairs.searchCredential(c.Request.Header.Get("Authorization")) + user, found := pairs.searchCredential(c.requestHeader("Authorization")) if !found { // Credentials doesn't match, we return 401 and abort handlers chain. c.Header("WWW-Authenticate", realm)