[MAGNOLIA-8887] HTTP response to request for asset contains in some cases header transfer-encoding chunked Created: 26/Apr/23  Updated: 18/Jun/23  Resolved: 31/May/23

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 6.2.33
Fix Version/s: 6.3.0, 6.2.35

Type: Bug Priority: Major
Reporter: Teresa Miyar Assignee: Antonín Juran
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 0.5d Time Spent: 0.5d
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Problem/Incident
relation
is related to MAGNOLIA-4713 Uncached pages are sent with incorrec... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MAGNOLIA-8911 Implementation Sub-task Completed Antonín Juran  
MAGNOLIA-8912 Code review Sub-task Completed Adam Siska  
MAGNOLIA-8913 Pre-integration QA Sub-task Completed Adam Siska  
MAGNOLIA-8914 Final QA Sub-task Completed Quach Hao Thien  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Epic Link: Nucleus Quality Maintenance
Sprint: Nucleus 37
Story Points: 3
T-Shirt Size: Small
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1. Upload a pdf
  2. run 
    curl -svko /dev/null -X GET 'http://localhost:8080/magnoliaPublic/dam/jcr:518d21bb-b021-43a4-b56d-fe13c16ed0e1/Kube.pdf' --http1.1 -H 'Range: bytes=0-20971519'

     (use bigger number then size of the document here, or 8192, see the comment)

  3. check output, when using http1.1 you can see the transfer-encoding set and content-length is 0, when using http1.0 content-length is 0

 

Expected results

no transfer-encoding header just content-length to the right size

.. Justify non-trivial expectations with a link to a doc or a relevant discussion.

Actual results

Workaround

disable filter for pdf's

Development notes



 Comments   
Comment by Quach Hao Thien [ 31/May/23 ]

QA:

The response returns correct Content-Length: 5494295

* Trying 18.156.123.172:443...
* Connected to nightly-public.magnolia-cms.com (18.156.123.172) port 443 (#0)
* ALPN: offers http/1.1
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Client hello (1):
} [333 bytes data]
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Unknown (8):
{ [10 bytes data]
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Certificate (11):
{ [5034 bytes data]
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* [CONN-0-0][CF-SSL] (304) (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* [CONN-0-0][CF-SSL] (304) (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / AEAD-AES128-GCM-SHA256
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
* subject: CN=sre.magnolia-cloud.com
* start date: Feb 14 00:00:00 2023 GMT
* expire date: Feb 8 23:59:59 2024 GMT
* issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M02
* SSL certificate verify ok.
> GET /dam/travel-demo/12-Rules-For-Life.pdf HTTP/1.1
> Host: nightly-public.magnolia-cms.com
> User-Agent: curl/7.87.0
> Accept: */*
> Range: bytes=0-20971519
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 206
< Date: Wed, 31 May 2023 06:42:33 GMT
< Content-Type: application/pdf;charset=UTF-8
< Content-Length: 5494295
< Connection: keep-alive
< Set-Cookie: JSESSIONID=6D9F5BD8528AA6B004C1537BD2A0390C; Path=/; HttpOnly
< X-Magnolia-Registration: Registered
< Cache-Control: max-age=600, public
< Expires: Wed, 31 May 2023 06:52:33 GMT
< Content-Disposition: attachment; filename="12 Rules For Life.pdf"
< Last-Modified: Wed, 31 May 2023 06:37:17 GMT
< ETag: F50F7463C5443F1B95966B587E9F5657A6F4BDB2
< Accept-Ranges: bytes
< Content-Range: bytes 0-5494294/5494295 

 

Generated at Mon Feb 12 04:36:41 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.