Skip to content
Myr

refactor: using requestHeader internal func (#1083)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* refactor: using requestHeader internal func. * update

authored by Bo-Yi Wu · committed by Javier Provecho Fernandez · parent fa391a4 · Browse files · 2 files+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

Diff stats

2 files+2 added−2 removed

  • other:+2 added−2 removed

2 files+2 added−2 removed

modified:auth.go+1 added-1 removed
45 unmodified lines
46 realm = "Basic realm=" + strconv.Quote(realm)47 pairs := processAccounts(accounts)48 return func(c *Context) {49 // Search user in the slice of allowed credentials50 user, found := pairs.searchCredential(c.Request.Header.Get("Authorization"))50 user, found := pairs.searchCredential(c.requestHeader("Authorization"))51 if !found {52 // Credentials doesn't match, we return 401 and abort handlers chain.53 c.Header("WWW-Authenticate", realm)54 c.AbortWithStatus(401)
41 unmodified lines
modified:context.go+1 added-1 removed
507 unmodified lines
508 }509 }510511 if c.engine.AppEngine {512 if addr := c.Request.Header.Get("X-Appengine-Remote-Addr"); addr != "" {512 if addr := c.requestHeader("X-Appengine-Remote-Addr"); addr != "" {513 return addr514 }515 }516
280 unmodified lines