-
-
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(routing): emit error for forbidden rewrite (#12339)
Co-authored-by: Reuben Tier <[email protected]> Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: Florian Lefebvre <[email protected]> Co-authored-by: Reuben Tier <[email protected]> Co-authored-by: Erika <[email protected]>
- Loading branch information
1 parent
d10f918
commit bdb75a8
Showing
7 changed files
with
88 additions
and
0 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,7 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Adds an error when `Astro.rewrite()` is used to rewrite an on-demand route with a static route when using the `"server"` output. | ||
|
||
This is a forbidden rewrite because Astro can't retrieve the emitted static route at runtime. This route is served by the hosting platform, and not Astro itself. |
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
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
4 changes: 4 additions & 0 deletions
4
packages/astro/test/fixtures/rewrite-server/src/pages/forbidden/dynamic.astro
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,4 @@ | ||
--- | ||
return Astro.rewrite("/forbidden/static") | ||
export const prerender = false | ||
--- |
3 changes: 3 additions & 0 deletions
3
packages/astro/test/fixtures/rewrite-server/src/pages/forbidden/static.astro
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,3 @@ | ||
--- | ||
export const prerender = true | ||
--- |
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