]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Fix the handling of HEAD requests that do not comply with RFC standards 59123/head
authorliubingrun <liubr1@chinatelecom.cn>
Tue, 16 Jul 2024 13:47:16 +0000 (09:47 -0400)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 10 Aug 2024 09:23:33 +0000 (16:23 +0700)
commit2974d05f31a37e78b7f595a48779d379efd6342d
tree25e7487d2506ca5acf76ceead66322792ed94ee9
parent9f4a78d6d334e9bbfd7dcdb1186532738d804c89
Fix the handling of HEAD requests that do not comply with RFC standards

    According to RFC 9110, The HEAD method is identical to GET except
    that the server MUST NOT send content in the response.

    And RFC 9112 indicates that Transfer-Encoding can be omitted in HEAD
    Response.

    The following HEAD OP is using chunked encoding and send the final chunk

    HEAD /bucket?uploads            RGWListBucketMultiparts_ObjStore_S3
    HEAD /bucket/abc?uploadId       RGWListMultipart_ObjStore_S3
    HEAD /                          RGWListBuckets_ObjStore_S3

    Clients using persistent connections, such as nginx, will be unable to handle
    subsequent requests after processing such requests because the final chunk
    remains in the TCP byte stream, preventing the next HTTP response from
    being correctly parsed.

    Ref: https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.2
         https://www.rfc-editor.org/rfc/rfc9112#section-6.1-9

Signed-off-by: liubingrun <liubr1@chinatelecom.cn>
(cherry picked from commit e63101650d43a60ae21e6c682f77175690542869)
src/rgw/rgw_rest.cc