diff options
author | Alix Lourme <alix.lourme@gmail.com> | 2022-04-14 02:19:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 02:19:16 (GMT) |
commit | 325d6f50357474c7d9fd2475be0e2481f7ae0476 (patch) | |
tree | 1f8facc03e5706824c667b64413ede8587fed241 /Lib/test/test_urllib2_localnet.py | |
parent | 5f056acdf28662e773ec5fe27db47ccad0e7671f (diff) | |
download | cpython-325d6f50357474c7d9fd2475be0e2481f7ae0476.zip cpython-325d6f50357474c7d9fd2475be0e2481f7ae0476.tar.gz cpython-325d6f50357474c7d9fd2475be0e2481f7ae0476.tar.bz2 |
gh-87497: Document that urllib.request sends headers in camel case (GH-24661)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test/test_urllib2_localnet.py')
-rw-r--r-- | Lib/test/test_urllib2_localnet.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index 3631431..f472935 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -617,6 +617,15 @@ class TestUrlopen(unittest.TestCase): pass self.assertEqual(handler.headers_received["Range"], "bytes=20-39") + def test_sending_headers_camel(self): + handler = self.start_server() + req = urllib.request.Request("http://localhost:%s/" % handler.port, + headers={"X-SoMe-hEader": "foobar"}) + with urllib.request.urlopen(req): + pass + self.assertIn("X-Some-Header", handler.headers_received.keys()) + self.assertNotIn("X-SoMe-hEader", handler.headers_received.keys()) + def test_basic(self): handler = self.start_server() with urllib.request.urlopen("http://localhost:%s" % handler.port) as open_url: |