Skip to content

Improve image signature handling and resizing functionality - #4511

Open
conico974 wants to merge 4 commits into
mainfrom
conico/improve-image-sig
Open

Improve image signature handling and resizing functionality#4511
conico974 wants to merge 4 commits into
mainfrom
conico/improve-image-sig

Conversation

@conico974

Copy link
Copy Markdown
Contributor

Enhance image processing by adding support for image signature version 3, and refining error handling in image resizing logic. Improve options and accept header handling for resizing functionality.

@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f02ccaa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@argos-ci

argos-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 6 changed, 4 ignored Aug 18, 2026, 10:36 AM
customers-v2-vercel (Inspect) ⚠️ Changes detected (Review) 9 changed, 6 ignored Aug 18, 2026, 10:34 AM
v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 1 changed, 2 ignored Aug 18, 2026, 10:37 AM
v2-vercel (Inspect) ⚠️ Changes detected (Review) 4 changed, 2 ignored Aug 18, 2026, 10:37 AM

@github-actions

Copy link
Copy Markdown
Contributor

Style invalidation on a large API reference

Elements restyled by opening one popup on the Snyk API reference. A share near or above 100% means the insertion restyles the whole document.

interaction restyled page share budget
openapi-select 580 10,838 5.4% 25%
search 1,081 10,838 10.0% 125%


/**
* Compare two signatures in constant time, to avoid leaking a valid signature byte by byte.
* We can't use `node:crypto`'s `timingSafeEqual` as this also runs on the edge runtime.

@jpreynat jpreynat Aug 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's available in vercel...

Comment on lines +135 to +146
case ImageRejectReason.UpstreamError:
// this one can happen for a lot of reasons, so we fallback to a redirect to the original image
// It sometimes happen when upstream block fetch from our server
throw new Error('Upstream error, falling back to a redirect');
case ImageRejectReason.UnsupportedContentType:
throw new Error('Unsupported content type, falling back to a redirect');
case ImageRejectReason.InternalError:
throw new Error('Internal error, falling back to a redirect');
default:
throw new Error(
`Unknown reject reason "${rejectReason}", falling back to a redirect`
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "original images" here are on the files.gitbook.com domain or another one?

The main risk of serving just anything on the current domain is that it causes issues with access to domain's private data (especially cookies, etc...). If redirecting to files.gitbook.com is the fallback, it could remain bad IMO because that could leak data from on main app's domain too.
We should just make sure where the images are served, and maybe in this case we could/should serve images on yet another, isolated domain.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants