Changeset 2490
- Timestamp:
- 08/04/09 23:53:06
- Files:
-
- branches/python3/cherrypy/test/test.py (modified) (1 diff)
- branches/python3/cherrypy/test/test_http.py (modified) (1 diff)
- branches/python3/cherrypy/wsgiserver/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/python3/cherrypy/test/test.py
r2479 r2490 459 459 'test_encoding', 460 460 'test_etags', 461 #'test_http',461 'test_http', 462 462 'test_httpauth', 463 463 'test_httplib', branches/python3/cherrypy/test/test_http.py
r2438 r2490 145 145 self.assertEqual(response.fp.read(22), b"Malformed Request-Line") 146 146 c.close() 147 147 148 def test_malformed_header(self): 149 if self.scheme == 'https': 150 c = http.client.HTTPSConnection('%s:%s' % (self.interface(), self.PORT)) 151 else: 152 c = http.client.HTTPConnection('%s:%s' % (self.interface(), self.PORT)) 153 c.putrequest('GET', '/') 154 c.putheader('Content-Type', 'text/plain') 155 # See http://www.cherrypy.org/ticket/941 156 c._output(b'Re, 1.2.3.4#015#012') 157 c.endheaders() 158 159 response = c.getresponse() 160 self.status = str(response.status) 161 self.assertStatus(400) 162 self.body = response.fp.read(20) 163 self.assertBody("Illegal header line.") 164 148 165 def test_http_over_https(self): 149 166 if self.scheme != 'https': branches/python3/cherrypy/wsgiserver/__init__.py
r2487 r2490 550 550 v = line.strip().decode('ISO-8859-1') 551 551 else: 552 k, v = line.split(b":", 1) 552 try: 553 k, v = line.split(b":", 1) 554 except ValueError: 555 raise ValueError("Illegal header line.") 553 556 k = k.strip().decode('ISO-8859-1').upper() 554 557 v = v.strip().decode('ISO-8859-1')

