Skip to content

Commit

Permalink
Refactor basic auth middleware to support multiple auth headers
Browse files Browse the repository at this point in the history
  • Loading branch information
aldas committed Oct 30, 2024
1 parent 0e4fdd6 commit 4ab78e4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions middleware/basic_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (config BasicAuthConfig) ToMiddleware() (echo.MiddlewareFunc, error) {
// multiple auth headers is something that can happen in environments like
// corporate test environments that are secured by application proxy servers where
// front facing proxy is also configured to require own basic auth value and does auth checks.
// In that case middleware can receive multiple auth headers.
for _, auth := range c.Request().Header[echo.HeaderAuthorization] {
if !(len(auth) > l+1 && strings.EqualFold(auth[:l], basic)) {
continue
Expand Down

0 comments on commit 4ab78e4

Please sign in to comment.