MCPcopy
hub / github.com/cherrypy/cherrypy / test_malformed_header

Method test_malformed_header

cherrypy/test/test_http.py:263–278  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

261 self.assertBody('Hello world!')
262
263 def test_malformed_header(self):
264 c = self.make_connection()
265 c.putrequest('GET', '/')
266 c.putheader('Content-Type', 'text/plain')
267 # See https://github.com/cherrypy/cherrypy/issues/941
268 c._output(b're, 1.2.3.4#015#012')
269 c.endheaders()
270
271 response = c.getresponse()
272 self.status = str(response.status)
273 self.assertStatus(400)
274 self.body = response.fp.read(20)
275 self.assertBody('Illegal header line.')
276
277 response.close()
278 c.close()
279
280 def test_http_over_https(self):
281 if self.scheme != 'https':

Callers

nothing calls this directly

Calls 3

make_connectionMethod · 0.95
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected