Work with latest eventlet (again)

See https://github.com/eventlet/eventlet/pull/826 and its follow-up,
https://github.com/eventlet/eventlet/pull/890

Change-Id: I7dff5342013a3f31f19cb410a9f3f6d4b60938f1
This commit is contained in:
Tim Burke 2024-01-16 15:12:33 -08:00
parent 2331c9abf2
commit 3ab9e45d6e
2 changed files with 3 additions and 2 deletions

View File

@ -30,6 +30,7 @@ else:
class SwiftHttpProtocol(wsgi.HttpProtocol):
default_request_version = "HTTP/1.0"
reject_bad_requests = False
def __init__(self, *args, **kwargs):
# See https://github.com/eventlet/eventlet/pull/590

View File

@ -49,7 +49,7 @@ from test.unit import mocked_http_conn, \
from swift.obj import server as object_server
from swift.obj import updater
from swift.obj import diskfile
from swift.common import utils, bufferedhttp
from swift.common import utils, bufferedhttp, http_protocol
from swift.common.header_key_dict import HeaderKeyDict
from swift.common.utils import hash_path, mkdirs, normalize_timestamp, \
NullLogger, storage_directory, public, replication, encode_timestamps, \
@ -5302,7 +5302,7 @@ class TestObjectController(BaseTestCase):
listener = listen_zero()
port = listener.getsockname()[1]
killer = spawn(wsgi.server, listener, self.object_controller,
NullLogger())
NullLogger(), protocol=http_protocol.SwiftHttpProtocol)
sock = connect_tcp(('localhost', port))
fd = sock.makefile('rwb')
s = 'PUT /sda1/p/a/c/o HTTP/1.1\r\nHost: localhost\r\n' \