diff -r 66d0f6ef2a7f Lib/test/test_urllib2net.py --- a/Lib/test/test_urllib2net.py Thu Feb 28 18:03:16 2013 +0200 +++ b/Lib/test/test_urllib2net.py Wed Mar 20 11:00:54 2013 -0400 @@ -177,6 +177,21 @@ opener.open(request) self.assertEqual(request.get_header('User-agent'),'Test-Agent') + def test_headers_case_sensitivity(self): + url = "http://www.example.com" + with support.transient_internet(url): + opener = urllib.request.build_opener() + request = urllib.request.Request(url) + headers = [("Content-Type", "text/plain"), ] + opener.addheaders = headers + opener.open(request) + self.assertTrue(request.has_header('Content-type')) + self.assertTrue(request.has_header('Content-Type')) + self.assertTrue(request.has_header('content-type')) + self.assertEqual(request.get_header('Content-type'), 'text/plain') + self.assertEqual(request.get_header('Content-Type'), 'text/plain') + self.assertEqual(request.get_header('content-type'), 'text/plain') + def test_sites_no_connection_close(self): # Some sites do not send Connection: close header. # Verify that those work properly. (#issue12576)