Skip to content

Commit c3936a5

Browse files
authored
fix: keep original auth header if x-forwarded-authorization isn't set (#794)
1 parent 3e2d5fe commit c3936a5

File tree

1 file changed

+3
-0
lines changed
  • cloud/common/runtime/gateway

1 file changed

+3
-0
lines changed

cloud/common/runtime/gateway/http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ func HttpHeadersToMap(rh *fasthttp.RequestHeader) map[string][]string {
7171
} else if strings.ToLower(keyString) == "authorization" {
7272
// Forward original authorization header
7373
headerCopy["X-Platform-Authorization"] = []string{string(val)}
74+
if _, exists := headerCopy["Authorization"]; !exists {
75+
headerCopy["Authorization"] = []string{string(val)}
76+
}
7477
} else {
7578
headerCopy[string(key)] = append(headerCopy[string(key)], string(val))
7679
}

0 commit comments

Comments
 (0)