fix(mixins/_parseBasicAuth): consider empty password as missing
This makes `username:` recognized as token, just like `username` is. This fixes token-based authentication in HttpProxy with cURL.
This commit is contained in:
parent
3bad40095a
commit
389a765825
@ -15,6 +15,8 @@ export function parseBasicAuth(header) {
|
||||
const i = credentials.indexOf(':')
|
||||
if (i === -1) {
|
||||
credentials = { token: credentials }
|
||||
} else if (i === credentials.length - 1) {
|
||||
credentials = { token: credentials.slice(0, i) }
|
||||
} else {
|
||||
// https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1
|
||||
credentials = {
|
||||
|
Loading…
Reference in New Issue
Block a user