Skip to content

Commit

Permalink
fix: allow ":" character in digestAuth password
Browse files Browse the repository at this point in the history
str.split() -function would cut rest of the password off when encountering a ":" character.
  • Loading branch information
kulpsin committed Sep 11, 2024
1 parent 5c7d555 commit efd9c4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ export function digestAuthHeader(method: string, uri: string, wwwAuthenticate: s
}

let qop = opts.qop || '';
const [ user, pass ] = userpass.split(':');
const index = userpass.indexOf(':');
const user = userpass.substring(0, index);
const pass = userpass.substring(index + 1);

let nc = String(++NC);
nc = `${NC_PAD.substring(nc.length)}${nc}`;
Expand Down

0 comments on commit efd9c4d

Please sign in to comment.