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

Commit 92a2eba

Browse files
author
Andreas Heider
committed
Make priority of header over body more explicit
1 parent 1912f72 commit 92a2eba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

path_login.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,12 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, d *framew
100100
// Clean ldap connection
101101
defer ldapConnection.Close()
102102

103-
authorizationString := d.Get("authorization").(string)
103+
authorizationString := ""
104104
authorizationHeaders := req.Headers["Authorization"]
105105
if len(authorizationHeaders) > 0 {
106106
authorizationString = authorizationHeaders[0]
107+
} else {
108+
authorizationString = d.Get("authorization").(string)
107109
}
108110

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

0 commit comments

Comments
 (0)