FreeBSD Bugzilla – Attachment 238536 Details for
Bug 268169
www/py-requests: Handle space-separated values in NO_PROXY
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Git-formatted patch
pr-268169.patch (text/plain), 2.10 KB, created by
Michael Osipov
on 2022-12-05 10:33:24 UTC
(
hide
)
Description:
Git-formatted patch
Filename:
MIME Type:
Creator:
Michael Osipov
Created:
2022-12-05 10:33:24 UTC
Size:
2.10 KB
patch
obsolete
>commit c8096ad9b5793754b669950a88012a1f25823d12 >Author: Michael Osipov <michael.osipov@siemens.com> >Date: 2022-12-05T11:29:04+01:00 > > www/py-requests: Handle space-separated values in NO_PROXY > > NO_PROXY is unfortunately not standardized, many applications and libs do > support whitespace- and comma-separated environment variable values. > py-requests does not and FreeBSD does not either in login.conf. > > See: > * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236204 > * https://github.com/psf/requests/pull/5465 > >diff --git a/www/py-requests/files/patch-requests_utils.py b/www/py-requests/files/patch-requests_utils.py >new file mode 100644 >index 000000000000..aeaf10141583 >--- /dev/null >+++ b/www/py-requests/files/patch-requests_utils.py >@@ -0,0 +1,11 @@ >+--- requests/utils.py.orig 2022-12-05 10:03:05 UTC >++++ requests/utils.py >+@@ -781,7 +781,7 @@ def should_bypass_proxies(url, no_proxy): >+ if no_proxy: >+ # We need to check whether we match here. We need to see if we match >+ # the end of the hostname, both with and without the port. >+- no_proxy = (host for host in no_proxy.replace(" ", "").split(",") if host) >++ no_proxy = (host for host in re.split('[, ]', no_proxy) if host) >+ >+ if is_ipv4_address(parsed.hostname): >+ for proxy_ip in no_proxy: >diff --git a/www/py-requests/files/patch-tests_test__utils.py b/www/py-requests/files/patch-tests_test__utils.py >new file mode 100644 >index 000000000000..a30ce011fed5 >--- /dev/null >+++ b/www/py-requests/files/patch-tests_test__utils.py >@@ -0,0 +1,11 @@ >+--- tests/test_utils.py.orig 2022-12-05 10:03:16 UTC >++++ tests/test_utils.py >+@@ -806,7 +806,7 @@ def test_should_bypass_proxies_no_proxy(url, expected, >+ """Tests for function should_bypass_proxies to check if proxy >+ can be bypassed or not using the 'no_proxy' argument >+ """ >+- no_proxy = "192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1" >++ no_proxy = "192.168.0.0/24,127.0.0.1 localhost.localdomain 172.16.1.1" >+ # Test 'no_proxy' argument >+ assert should_bypass_proxies(url, no_proxy=no_proxy) == expected >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 268169
: 238536