This commit is contained in:
James Brumond 2023-08-18 21:42:00 -07:00
parent 2a8da3e510
commit 3c3c6ca421
Signed by: james
GPG Key ID: E8F2FC44BAA3357A
3 changed files with 7 additions and 1 deletions

3
dist/index.js vendored
View File

@ -3129,6 +3129,8 @@ function parse_www_authenticate(www_authenticate) {
parameters[key] = remaining.slice(1, close_index);
remaining = remaining.slice(close_index + 1);
console.log({ key, value: parameters[key] });
if (remaining && remaining[0] !== ',') {
console.log({ remaining });
throw new Error('invalid www-authenticate header (expected comma after closing quote)');
@ -3151,6 +3153,7 @@ function parse_www_authenticate(www_authenticate) {
}
const { realm, service, scope } = parameters;
console.log({ parameters });
if (! realm || ! service || ! scope) {
throw new Error('invalid www-authenticate header (missing "realm", "service", or "scope")');

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -215,6 +215,8 @@ function parse_www_authenticate(www_authenticate) {
parameters[key] = remaining.slice(1, close_index);
remaining = remaining.slice(close_index + 1);
console.log({ key, value: parameters[key] });
if (remaining && remaining[0] !== ',') {
console.log({ remaining });
throw new Error('invalid www-authenticate header (expected comma after closing quote)');
@ -237,6 +239,7 @@ function parse_www_authenticate(www_authenticate) {
}
const { realm, service, scope } = parameters;
console.log({ parameters });
if (! realm || ! service || ! scope) {
throw new Error('invalid www-authenticate header (missing "realm", "service", or "scope")');