Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Make priority of header over body more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Heider committed Aug 3, 2018
1 parent 1912f72 commit 92a2eba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, d *framew
// Clean ldap connection
defer ldapConnection.Close()

authorizationString := d.Get("authorization").(string)
authorizationString := ""
authorizationHeaders := req.Headers["Authorization"]
if len(authorizationHeaders) > 0 {
authorizationString = authorizationHeaders[0]
} else {
authorizationString = d.Get("authorization").(string)
}

s := strings.SplitN(authorizationString, " ", 2)
Expand Down

0 comments on commit 92a2eba

Please sign in to comment.