Project

General

Profile

Actions

Bug #23591

open

wrong Content-Length for website error page

Added by Shengjing Zhu about 6 years ago. Updated almost 6 years ago.

Status:
New
Priority:
Normal
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I replaced the real host with example.com in following log.

$ curl  s3-website.example.com/bucket1 -v  
* TCP_NODELAY set
* Connected to s3-website.example.com (1.1.1.1) port 80 (#0)
> GET /bucket1 HTTP/1.1
> Host: s3-website.example.com
> User-Agent: curl/7.58.0
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Content-Length: 278
< x-amz-request-id: tx0000000000000000038e4-005aca0131-10159c-zone-a
< Accept-Ranges: bytes
< Content-Type: text/html
< Date: Sun, 08 Apr 2018 11:46:57 GMT
< 
<html>
<head><title>404 Not Found</title></head>
<body>
<h1>404 Not Found</h1>
<ul>
<li>Code: NoSuchWebsiteConfiguration</li>
<li>BucketName: bucket1</li>
<li>RequestId: tx0000000000000000038e4-005aca0131-10159c-zone-a</li>
<li>HostId: 10159c-zone-a-zg-a</li>
* Connection #0 to host s3-website.example.com left intact

As described in log, the error page is truncated due to the wrong Content-Length.

If I use telnet, we will get

$ telnet 1.1.1.1 80
Trying 1.1.1.1...
Connected to 1.1.1.1.
Escape character is '^]'.
GET /bucket1 HTTP/1.1
Host: s3-website.example.com

HTTP/1.1 404 Not Found
Content-Length: 278
x-amz-request-id: tx0000000000000000042c4-005aca0238-10159c-zone-a
Accept-Ranges: bytes
Content-Type: text/html
Date: Sun, 08 Apr 2018 11:51:20 GMT

<html>
 <head><title>404 Not Found</title></head>
 <body>
  <h1>404 Not Found</h1>
  <ul>
   <li>Code: NoSuchWebsiteConfiguration</li>
   <li>BucketName: bucket1</li>
   <li>RequestId: tx0000000000000000042c4-005aca0238-10159c-zone-a</li>
   <li>HostId: 10159c-zone-a-zg-a</li>
  </ul>
 </body>
</html>

The content length should be 303

Actions #1

Updated by Orit Wasserman almost 6 years ago

  • Assignee set to Orit Wasserman
Actions

Also available in: Atom PDF