Skip to content

Commit

Permalink
fix: support special characters in username/password of git url
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-titarenko committed Nov 8, 2023
1 parent 5487132 commit 0bda2ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/extractAuthFromUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ export function extractAuthFromUrl(url: string): { url: string, auth: Auth } {
// Remove credentials from URL
url = url.replace(`${userpass}@`, '')
// Has credentials, return the fetch-safe URL and the parsed credentials
return { url, auth: { username, password } }
return {
url: url,
auth: {
username: decodeURIComponent(username),
password: decodeURIComponent(password)
}
}
}

0 comments on commit 0bda2ac

Please sign in to comment.