MCPcopy Index your code
hub / github.com/python/cpython / test_putrequest_override_host_validation

Method test_putrequest_override_host_validation

Lib/test/test_httplib.py:1593–1602  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1591 conn.putrequest('GET', '/\x00')
1592
1593 def test_putrequest_override_host_validation(self):
1594 class UnsafeHTTPConnection(client.HTTPConnection):
1595 def _validate_host(self, url):
1596 pass
1597
1598 conn = UnsafeHTTPConnection('example.com\r\n')
1599 conn.sock = FakeSocket('')
1600 # set skip_host so a ValueError is not raised upon adding the
1601 # invalid URL as the value of the "Host:" header
1602 conn.putrequest('GET', '/', skip_host=1)
1603
1604 def test_putrequest_override_encoding(self):
1605 """

Callers

nothing calls this directly

Calls 3

putrequestMethod · 0.80
FakeSocketClass · 0.70

Tested by

no test coverage detected