def test_006_reject_long_urls(self):
sock = eventlet.connect(self.server_addr)
path_parts = []
for ii in range(3000):
path_parts.append('path')
path = '/'.join(path_parts)
request = 'GET /%s HTTP/1.0\r\nHost: localhost\r\n\r\n' % path
send_expect_close(sock, request.encode())
fd = sock.makefile('rb')
result = fd.readline()
if result:
# windows closes the socket before the data is flushed,
# so we never get anything back
status = result.split(b' ')[1]
self.assertEqual(status, b'414')
fd.close()
评论列表
文章目录