We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d335707 commit 07c20adCopy full SHA for 07c20ad
packages/service-utils/src/node/index.ts
@@ -76,13 +76,11 @@ function getHeader(
76
headers: IncomingHttpHeaders | Headers,
77
headerName: string,
78
): string | null {
79
- const header = isNodeHeaders(headers)
80
- ? headers[headerName]
+ return isNodeHeaders(headers)
+ ? Array.isArray(headers[headerName])
81
+ ? (headers[headerName]?.[0] ?? null)
82
+ : (headers[headerName] ?? null)
83
: headers.get(headerName);
- if (Array.isArray(header)) {
- return header?.[0] ?? null;
84
- }
85
- return header ?? null;
86
}
87
88
export function extractAuthorizationData(
0 commit comments