diff --git a/twisted/web/http_headers.py b/twisted/web/http_headers.py
index 0b93fcf..9663ac6 100644
|
a
|
b
|
|
| 132 | 132 | @ivar _rawHeaders: A C{dict} mapping header names as C{str} to C{lists} of |
| 133 | 133 | header values as C{str}. |
| 134 | 134 | """ |
| 135 | | _caseMappings = {'www-authenticate': 'WWW-Authenticate'} |
| | 135 | _caseMappings = { |
| | 136 | 'content-md5': 'Content-MD5', |
| | 137 | 'dnt': 'DNT', |
| | 138 | 'etag': 'ETag', |
| | 139 | 'p3p': 'P3P', |
| | 140 | 'te': 'TE', |
| | 141 | 'www-authenticate': 'WWW-Authenticate', |
| | 142 | 'x-xss-protection': 'X-XSS-Protection'} |
| 136 | 143 | |
| 137 | 144 | def __init__(self, rawHeaders=None): |
| 138 | 145 | self._rawHeaders = {} |
diff --git a/twisted/web/test/test_http_headers.py b/twisted/web/test/test_http_headers.py
index 1305478..713e840 100644
|
a
|
b
|
|
| 138 | 138 | the given header. |
| 139 | 139 | """ |
| 140 | 140 | h = Headers() |
| 141 | | self.assertEqual(h._canonicalNameCaps("test"), "Test") |
| 142 | | self.assertEqual(h._canonicalNameCaps("test-stuff"), "Test-Stuff") |
| 143 | | self.assertEqual(h._canonicalNameCaps("www-authenticate"), |
| | 141 | self.assertEquals(h._canonicalNameCaps("test"), "Test") |
| | 142 | self.assertEquals(h._canonicalNameCaps("test-stuff"), "Test-Stuff") |
| | 143 | self.assertEquals(h._canonicalNameCaps("content-md5"), "Content-MD5") |
| | 144 | self.assertEquals(h._canonicalNameCaps("dnt"), "DNT") |
| | 145 | self.assertEquals(h._canonicalNameCaps("etag"), "ETag") |
| | 146 | self.assertEquals(h._canonicalNameCaps("p3p"), "P3P") |
| | 147 | self.assertEquals(h._canonicalNameCaps("te"), "TE") |
| | 148 | self.assertEquals(h._canonicalNameCaps("www-authenticate"), |
| 144 | 149 | "WWW-Authenticate") |
| | 150 | self.assertEquals(h._canonicalNameCaps("x-xss-protection"), |
| | 151 | "X-XSS-Protection") |
| 145 | 152 | |
| 146 | 153 | |
| 147 | 154 | def test_getAllRawHeaders(self): |
diff --git a/twisted/web/topfiles/5054.bugfix b/twisted/web/topfiles/5054.bugfix
new file mode 100644
index 0000000..a63c28e
|
a
|
b
|
|
| | 1 | twisted.web.http_headers.Headers now correctly capitalizes the header names |
| | 2 | Content-MD5, DNT, ETag, P3P, TE, and X-XSS-Protection. |