Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

og:image preview bails out if Content-Length header is missing, many image CDNs use streaming or chunked encoding now #6645

Open
2 tasks done
jonsherrard opened this issue Oct 18, 2023 · 1 comment · May be fixed by #7046
Labels

Comments

@jonsherrard
Copy link

  • I have searched open and closed issues for duplicates
  • I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.

Bug Description

Steps to Reproduce

  1. step one
    Open a chat
  2. step two
    Paste https://vercel.com/docs/functions/edge-functions/og-image-generation
  3. step three
    Notice there is no OG image loaded.

Actual Result:

No image preview is laoded in the chat is because vercel's image servers don't set a content-length, so it bails out:

if (contentLength > MAX_IMAGE_CONTENT_LENGTH) {

Expected Result:

The image preview should load.

Screenshots

Signal:
image

Other chat app:
image

Platform Info

Signal Version:

6.34.1
production (Apple silicon)

Operating System:

14.0 (23A344)

Linked Device Version:

@der-eismann
Copy link

der-eismann commented Oct 9, 2024

We just stumbled upon the same issue with our website, where we serve images from CloudFront with compression enabled. Since CloudFront dismisses the Content-Length header on compressed requests, we are not getting any preview images.
Would be great if we could find a solution for this, especially since the mobile app is not affected by this.

FTR these are the headers served by CloudFront:

< HTTP/2 200 
< content-type: image/jpeg
< date: Wed, 09 Oct 2024 16:49:57 GMT
< cache-control: max-age=315360000,public
< etag: "3b0c79e2613…"
< expires: Sat, 07 Oct 2034 16:49:57 GMT
< vary: Accept
< x-cache: Miss from cloudfront
< via: 1.1 ….cloudfront.net (CloudFront)
< x-amz-cf-pop: …
< alt-svc: h3=":443"; ma=86400
< x-amz-cf-id: skD88pp1R…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants