mirror of
https://github.com/hanzoai/passport-jwt.git
synced 2026-09-24 17:01:40 +00:00
10 lines
268 B
TypeScript
10 lines
268 B
TypeScript
const HdrRegex = /(\S+)\s+(\S+)/;
|
|
|
|
export function parseAuthHeader(hdrValue?: string) {
|
|
if (typeof hdrValue !== 'string') {
|
|
return null;
|
|
}
|
|
const matches = hdrValue.match(HdrRegex);
|
|
return matches && { scheme: matches[1], value: matches[2] };
|
|
}
|