From: Radoslaw Zarzynski Date: Wed, 5 Oct 2016 22:09:00 +0000 (+0200) Subject: rgw: fix setting HTTP/0.0 in AsioConnection::write_bad_request. X-Git-Tag: v11.1.0~454^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c3268600848e30e3e451a299ee5dbcd5a2699e7;p=ceph.git rgw: fix setting HTTP/0.0 in AsioConnection::write_bad_request. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index a7bda0b3ed2..08c8d939a57 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -101,7 +101,9 @@ class AsioConnection : public std::enable_shared_from_this { beast::http::response_v1 response; response.status = 400; response.reason = "Bad Request"; - response.version = request.version; + /* If the request is so terribly malformed that we can't extract even + * the protocol version, we will use HTTP/1.1 as a fallback. */ + response.version = request.version ? request.version : 11; beast::http::prepare(response); beast::http::async_write(socket, std::move(response), std::bind(&AsioConnection::on_write,