]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix the Content-Length in response header is inconsistent with response body...
authormengxiangrui <mengxr@chinatelecom.cn>
Sat, 21 Aug 2021 07:20:00 +0000 (15:20 +0800)
committerMark Kogan <mkogan@ibm.com>
Thu, 14 Nov 2024 16:27:02 +0000 (16:27 +0000)
The default html error page as response body should be built completely include three ending html symbols(/ul, /body and /html) before rgw computes Content-Length in response header. The Content-Length in response header will be consistent with response body size. Client can get complete page.

Fixes: https://tracker.ceph.com/issues/52363
(cherry picked from commit cbeaef9fbe96c930fc10b793773e7ecd137fde81)

Co-authored-by: aicun hu <huaicun@chinatelecom.cn>
Co-authored-by: yupeng chen <chenyupeng@chinatelecom.cn>
Signed-off-by: xiangrui meng <mengxr@chinatelecom.cn>
(cherry picked from commit e0bb8313fdfdc86352e8e2343599c02e574aeae3)

src/rgw/rgw_rest.cc

index fa62e19a51196ef6548a254fb942298bb5d08d82..103651833b4ecb6f535888fb0f4273e65759bb22 100644 (file)
@@ -607,6 +607,7 @@ void end_header(req_state* s, RGWOp* op, const char *content_type,
   if (!force_no_error && s->is_err()) {
     dump_start(s);
     dump(s);
+    s->formatter->output_footer();
     dump_content_length(s, s->formatter->get_len());
   } else {
     if (proposed_content_length == CHUNKED_TRANSFER_ENCODING) {