6
submitted 3 months ago* (last edited 3 months ago) by activistPnk to c/meta

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
top 4 comments
sorted by: hot top controversial new old
[-] navigatron@beehaw.org 3 points 3 months ago

That accept-ranges: bytes header smells like a rabbithole that might have clues. It could also just be a bug, I’m not sure

[-] poVoq 2 points 3 months ago

Can you please confirm if other Lemmy instances behave the same way?

[-] activistPnk 2 points 3 months ago

Appears 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
[-] poVoq 3 points 3 months ago* (last edited 3 months ago)

My 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.

this post was submitted on 22 Jan 2024
6 points (100.0% liked)

Meta (slrpnk.net)

549 readers
12 users here now

Here we can discuss anything about this Lemmy instance/server itself.

Our XMPP support chat: Movim or XMPP client.

Please also refer to our Wiki

founded 2 years ago
MODERATORS