]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix setting HTTP/0.0 in AsioConnection::write_bad_request.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Wed, 5 Oct 2016 22:09:00 +0000 (00:09 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 21 Oct 2016 20:57:21 +0000 (22:57 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_asio_frontend.cc

index a7bda0b3ed24bdd59292bc5fe20e369b2cf44064..08c8d939a571600c5a64ddaaa90d4518b67d7726 100644 (file)
@@ -101,7 +101,9 @@ class AsioConnection : public std::enable_shared_from_this<AsioConnection> {
     beast::http::response_v1<beast::http::empty_body> 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,