Project

General

Profile

Actions

Bug #52363

open

rgw: fix the Content-Length in response header is inconsistent with response body size when rgw returns default html error page in static website

Added by XiangRui Meng over 2 years ago. Updated 8 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
website backport_processed
Backport:
pacific quincy reef
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Suppose the rgw website instance's domain name is objects-website-region.domain.com, then I curl the domain name, it will return as follows.

curl http://objects-website-region.domain.com
<html>
 <head><title>404 Not Found</title></head>
 <body>
  <h1>404 Not Found</h1>
  <ul>
   <li>Code: NoSuchBucket</li>
   <li>RequestId: tx000000000000000000002-00612025dd-3529e9-default</li>
   <li>HostId: 3529e9-default-default</li>

I find the html page is incomplete, it lacks </ul>, </body> and </html> symbol. This happens because the Content-Length in response header only counts the above page size, then the whole response header is sent to client. Next, in rgw flushes formatter, the above three missing html symbols are supplemented in html page before rgw sends response body to client. The Content-Length is less than actual response body size at here. By grabbing packets to see, the HTTP response includes two reassembled tcp segments, so I only get an incomplete page. The correct result that should be returned is as follows.
<html>
 <head><title>404 Not Found</title></head>
 <body>
  <h1>404 Not Found</h1>
  <ul>
   <li>Code: NoSuchBucket</li>
   <li>RequestId: tx000000000000000000002-00612025dd-3529e9-default</li>
   <li>HostId: 3529e9-default-default</li>
  </ul>
 </body>
</html>


Related issues 3 (2 open1 closed)

Copied to rgw - Backport #62253: pacific: rgw: fix the Content-Length in response header is inconsistent with response body size when rgw returns default html error page in static websiteRejectedMark KoganActions
Copied to rgw - Backport #62254: quincy: rgw: fix the Content-Length in response header is inconsistent with response body size when rgw returns default html error page in static websiteNewMark KoganActions
Copied to rgw - Backport #62255: reef: rgw: fix the Content-Length in response header is inconsistent with response body size when rgw returns default html error page in static websiteNewMark KoganActions
Actions

Also available in: Atom PDF