Summary
# curl -sv http://127.0.0.1:8088/media/icons/1483528200372891649/3a5ab250.webp?size=160 -o /dev/null
* Trying 127.0.0.1:8088...
* Connected to 127.0.0.1 (127.0.0.1) port 8088
> GET /media/icons/1483528200372891649/3a5ab250.webp?size=160 HTTP/1.1
> Host: 127.0.0.1:8088
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 200 OK
< accept-ranges: bytes
< access-control-allow-origin: *
< cache-control: public, max-age=31536000
< content-length: 5190
< content-type: image/webp
< date: Thu, 19 Mar 2026 05:41:47 GMT
< expires: Fri, 19 Mar 2027 05:41:47 GMT
< last-modified: Thu, 19 Mar 2026 05:41:47 GMT
< vary: Accept-Encoding, Range
< x-request-id: 7b3ec127-4197-4b21-bc39-87dd66010b16
< Content-Length: 5190
< Connection: keep-alive
< Keep-Alive: timeout=5
<
{ [5190 bytes data]
* Connection #0 to host 127.0.0.1 left intact
Steps to reproduce
- upload any file on a self hosted instance, for example an avatar
- watch the browser console for a 502 error.
- check the response header and note the duplicate content-length.
2 comments
Comment by Rex
Comment by @treminaor
1. packages/media_proxy/src/lib/HttpUtils.tsx
Removed manual Content-Length headers from media responses. Before:2. packages/s3/src/s3/ObjectController.tsx
Partially removed manual Content-Length handling in the normal non-range GET path. From the current snippet, the non-range branch no longer sets Content-Length, but the range branch still does. Current relevant block: