Skip to content

Commit

Permalink
feat: add support for URL safe encoding
Browse files Browse the repository at this point in the history
due to a bug in node.js some clients will end up encoding the value
before base64 which results in the incorrect value being parsed.
ref: nodejs/node#31439
  • Loading branch information
andrei-cdl committed Aug 9, 2021
1 parent e8a29f9 commit ee11070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function parse (string) {
}

// decode user pass
var userPass = USER_PASS_REGEXP.exec(decodeBase64(match[1]))
var userPass = USER_PASS_REGEXP.exec(decodeURIComponent(decodeBase64(match[1])))

if (!userPass) {
return undefined
Expand Down

0 comments on commit ee11070

Please sign in to comment.