From 3ab9e45d6e10dab08fa81b58aec30dd2706d4c3d Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Tue, 16 Jan 2024 15:12:33 -0800 Subject: [PATCH] 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 --- swift/common/http_protocol.py | 1 + test/unit/obj/test_server.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/swift/common/http_protocol.py b/swift/common/http_protocol.py index 23716a46cf..8147ad5597 100644 --- a/swift/common/http_protocol.py +++ b/swift/common/http_protocol.py @@ -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 diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py index e728a9efe9..5cebef7a36 100644 --- a/test/unit/obj/test_server.py +++ b/test/unit/obj/test_server.py @@ -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' \