-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
mx appears to only support unauthorized http_proxys following the format http://host:port while it should also support http://user:password@host:port and set http.proxyUser and http.proxyPassword accordingly.
The code at fault is:
| def _parse_http_proxy(envVarNames): | |
| """ | |
| Parses the value of the first existing environment variable named | |
| in `envVarNames` into a host and port tuple where port is None if | |
| it's not present in the environment variable. | |
| """ | |
| p = re.compile(r'(?:https?://)?([^:]+):?(\d+)?/?$') | |
| for name in envVarNames: | |
| value = get_env(name) | |
| if value: | |
| m = p.match(value) | |
| if m: | |
| return m.group(1), m.group(2) | |
| else: | |
| abort("Value of " + name + " is not valid: " + value) | |
| return (None, None) |
and
| host, port = _parse_http_proxy(["HTTP_PROXY", "http_proxy"]) | |
| add_proxy_property('proxyHost', host) | |
| add_proxy_property('proxyPort', port) | |
| host, port = _parse_http_proxy(["HTTPS_PROXY", "https_proxy"]) | |
| add_proxy_property('https.proxyHost', host) | |
| add_proxy_property('https.proxyPort', port) |
Metadata
Metadata
Assignees
Labels
No labels