-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(image): Fix astro:assets from interfering with SSR query params e…
…nding with image extensions (#7055) * fix(image): Fix `astro:assets` from interfering with SSR query params ending with image extensions * test: add test * nit: nit * chore: changeset
- Loading branch information
1 parent
dad5e2e
commit 4f1073a
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fix astro:assets interfering with SSR query params ending with image extensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/core-image-ssr/src/pages/api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { APIRoute } from "../../../../../src/@types/astro"; | ||
|
||
export const get = (async ({ params, request }) => { | ||
const url = new URL(request.url); | ||
console.log(url) | ||
const src = url.searchParams.get("src"); | ||
|
||
return { | ||
body: "An image: " + JSON.stringify(src), | ||
}; | ||
}) satisfies APIRoute; |