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

fix: make image endpoint highest priority #12591

Merged
merged 3 commits into from
Dec 3, 2024
Merged

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Dec 3, 2024

Changes

Ensures that the image endpoint is highest priority, by adding it to the start of the route array rather than the end

Testing

Tested locally with repro site

Fixes #12589. Thanks @MathiasGmeiner

Docs

Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: e8e5a78

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 3, 2024
@ascorbic
Copy link
Contributor Author

ascorbic commented Dec 3, 2024

!preview image-endpoint

@@ -23,7 +23,7 @@ export function ensureImageEndpointRoute(
cwd?: string,
) {
if (!manifest.routes.some((route) => route.route === '/_image')) {
Copy link
Member

Choose a reason for hiding this comment

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

oh, this condition is probably not good, you can change the path of the image endpoint. It should use the config to find the path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. A different issue but we can include it in this

Copy link

codspeed-hq bot commented Dec 3, 2024

CodSpeed Performance Report

Merging #12591 will not alter performance

Comparing image-endpoint-fox (e8e5a78) with main (10c6b8d)

Summary

✅ 6 untouched benchmarks

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

I checked out the branch, and confirmed that the tests passed on my machine too

@ascorbic
Copy link
Contributor Author

ascorbic commented Dec 3, 2024

I'm going to wait til they pass in CI before merging

@ematipico ematipico merged commit b731b3d into main Dec 3, 2024
16 checks passed
@ematipico ematipico deleted the image-endpoint-fox branch December 3, 2024 10:51
@astrobot-houston astrobot-houston mentioned this pull request Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[5.0 Beta] catchall route matches _image endpoint in Node
4 participants