-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For #33172, support @ in proxy authentication passwords
Splitting the string on @ was the right idea, but we have to do it from the end, since the password might have @ in it. Splitting from the end is safe since the the host and port number can't have this character. Closes #105
- Loading branch information
1 parent
d1318fa
commit c4f4c00
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -429,8 +429,9 @@ def __init__(self, | |
|
||
# foo:[email protected]:3456 | ||
if http_proxy: | ||
# check if we're using authentication | ||
p = http_proxy.split("@", 1) | ||
# check if we're using authentication. Start from the end since there might be | ||
# @ in the user's password. | ||
p = http_proxy.rsplit("@", 1) | ||
if len(p) > 1: | ||
self.config.proxy_user, self.config.proxy_pass = \ | ||
p[0].split(":", 1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters