diff options
| author | Jayaprakash Nevara <43479544+jpshivakavi@users.noreply.github.com> | 2019-03-29 22:53:43 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-29 22:53:43 +0530 |
| commit | ef823096c8e8f7e28d59d8891998a4b5267025cc (patch) | |
| tree | 399aeaeb5c3a5a7715939d532c79aef17c1de68e /websocket | |
| parent | 3c25814664fef5b78716ed8841123ed1c0d17824 (diff) | |
| download | websocket-client-ef823096c8e8f7e28d59d8891998a4b5267025cc.tar.gz | |
v should be checked for emptry string before splitting it
when name 'v' has empty string on splitting this empty string we get a list with empty string like ['']
This will make the next if statement "if not no_proxy:" false.
This is leading to a bug where a connection initiated from a localhost / 127.0.0.1 will not be considered as no_proxy type of connection.
Leading to an exception ValueError("scheme %s is invalid" % scheme) with the scheme value set to http from parse_url() function
Diffstat (limited to 'websocket')
| -rw-r--r-- | websocket/_url.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/websocket/_url.py b/websocket/_url.py index ae46d6c..a394fc3 100644 --- a/websocket/_url.py +++ b/websocket/_url.py @@ -103,7 +103,8 @@ def _is_address_in_network(ip, net): def _is_no_proxy_host(hostname, no_proxy): if not no_proxy: v = os.environ.get("no_proxy", "").replace(" ", "") - no_proxy = v.split(",") + if v: + no_proxy = v.split(",") if not no_proxy: no_proxy = DEFAULT_NO_PROXY_HOST |
