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) diff --git a/context.go b/context.go index 6f2b0053..2be7010d 100644 --- a/context.go +++ b/context.go @@ -509,7 +509,7 @@ func (c *Context) ClientIP() string { } if c.engine.AppEngine { - if addr := c.Request.Header.Get("X-Appengine-Remote-Addr"); addr != "" { + if addr := c.requestHeader("X-Appengine-Remote-Addr"); addr != "" { return addr } }