mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-07 16:47:24 +00:00
Add fallback to lowercase authoriation header lookup
This commit is contained in:
parent
f8d0efe6c3
commit
3297776240
1 changed files with 4 additions and 0 deletions
|
|
@ -617,6 +617,10 @@ func AuditAttributesFromAuthorizationHeader(request *Request) (
|
|||
var delegationInfo []*auditV1.ServiceAccountDelegationInfo = nil
|
||||
|
||||
authorizationHeaders := request.Header["Authorization"]
|
||||
if len(authorizationHeaders) == 0 {
|
||||
// fallback for grpc where headers/metadata keys are lowercase
|
||||
authorizationHeaders = request.Header["authorization"]
|
||||
}
|
||||
authorizationHeader := strings.Join(authorizationHeaders, ",")
|
||||
trimmedAuthorizationHeader := strings.TrimSpace(authorizationHeader)
|
||||
if len(trimmedAuthorizationHeader) > 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue