Fix the listen() invocation for the test server not to pass a backlog
value of zero. The value of zero means no backlog which effectively
means that the socket can not accept any connections. This does not
matter for the majority of platforms since the value is only advisory
and the platform tends to go with a bigger backlog anyway. However,
a few platforms (e.g. alpha or riscv Linux) do take the value literally,
and therefore the tests fail since they are unable to connect to
the server.
pytest-httpbin<1.0 ships with a server certificate with a commonName but
no subjectAltName. urllib3 2.0 will stop supporting those in the future,
so we want to upgrade pytest-httpbin.
Unfortunately, `test_https_warnings` was relying on this broken
certificate. With this change, we use `trustme` to create a broken
certificate specifically for this test, so that we can upgrade
pytest-httpbin and make sure that other tests relying on httpbin TLS
support will continue to work with urllib3 2.0.
* disallow nan values in json serialize
* test nan value in json post
* added exception for invalid json in request
* use invalid json exception
* invalid json test
The shim is the same on both Python 2 & 3. It is always
collections.OrderedDict. Avoid the indirection and import from Python
stdlib instead.
Keep requests.compat.OrderedDict for backwards compatibility. Some
packages import this.
Previously the header was stripped only if the hostname changed, but in
an https -> http redirect that can leak the credentials on the wire
(#4716). Based on with RFC 7235 section 2.2, the header is now stripped
if the "canonical root URL" (scheme+authority) has changed, by checking
scheme, hostname and port.
>>> from requests import post
>>> r = post("https://example.com", files={"file-name": None})
However, when a param value or json field is None they are not included in the request body.
>>> from requests import get
>>> r = get("https://example.com", params={"file-name": None})
>>> r.request.url
This commit makes the beahviour consistent for files.
* #4373, fix possible winreg value type difference
* add a test for ProxyOverride and ProxyEnable on win32
* add tests for winreg key ProxyEnable with two possible types
* fixing AppVeyor failures