-
-
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.
Provide correct MIME type for dynamic endpoint routes in dev (#4356)
- Loading branch information
Showing
5 changed files
with
51 additions
and
1 deletion.
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 | ||
--- | ||
|
||
Provide correct MIME type for dynamic endpoint routes in dev |
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
14 changes: 14 additions & 0 deletions
14
packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/[image].svg.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,14 @@ | ||
export async function getStaticPaths() { | ||
return [ | ||
{ params: { image: 1 } }, | ||
{ params: { image: 2 } }, | ||
]; | ||
} | ||
|
||
export async function get({ params }) { | ||
return { | ||
body: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200"> | ||
<title>${params.image}</title> | ||
</svg>` | ||
}; | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/astro/test/fixtures/with-endpoint-routes/src/pages/images/static.svg.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,7 @@ | ||
export async function get() { | ||
return { | ||
body: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200"> | ||
<title>Static SVG</title> | ||
</svg>` | ||
}; | ||
} |