slrpnk.net not giving file size in headers
slrpnk.net not giving file size in headers
I wanted to see the image size for this post before deciding to download the image. Normally curl -i
returns a “content-length”, but not in this case:
$ curl -i 'https://slrpnk.net/pictrs/image/67127e8e-52ef-42ad-bf39-424b9052ef90.webp'
HTTP/2 200
server: nginx
date: Mon, 22 Jan 2024 09:56:56 GMT
content-type: image/webp
last-modified: Sat, 20 Jan 2024 16:24:40 GMT
vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
access-control-expose-headers: last-modified, content-type, accept-ranges, date, cache-control, transfer-encoding
cache-control: public, max-age=604800, immutable
accept-ranges: bytes
strict-transport-security: max-age=63072000
referrer-policy: same-origin
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 1; mode=block
Seems like a bug, no?
UPDATE
I don’t do github so I reported the bug here in the off chance that someone notices.
UPDATE 2
Got “content-length: 0” this time:
$ curl -I 'https://slrpnk.net/pictrs/image/a1582706-199c-4994-9c4b-3057f85f3b97.webp'
HTTP/2 405
server: nginx
date: Sun, 11 Feb 2024 09:39:44 GMT
content-length: 0
vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
allow: GET
cache-control: public, max-age=60
access-control-expose-headers: allow
3 comments
Can you please confirm if other Lemmy instances behave the same way?
2 0 ReplyAppears so.
$ curl -i https://lemmy.ml/pictrs/image/8122d979-9b5a-4c2b-bced-a685a1e05030.jpeg HTTP/2 200 server: nginx date: Mon, 22 Jan 2024 11:55:17 GMT content-type: image/jpeg vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers last-modified: Tue, 24 Oct 2023 08:09:58 GMT cache-control: public, max-age=604800, immutable access-control-expose-headers: accept-ranges, date, last-modified, content-type, cache-control, transfer-encoding accept-ranges: bytes referrer-policy: same-origin x-content-type-options: nosniff x-frame-options: DENY x-xss-protection: 1; mode=block
2 0 ReplyMy guess is that this is a result of the Lemmy back end proxying all images served by pict-rs.
Personally I think that is a bad design choice, but I am not deep enough into the topic to really have a qualified opinion on it.
3 0 Reply