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
Rewriting #901
base: main
Are you sure you want to change the base?
Rewriting #901
Conversation
Internally, the `reroute` **must** create a new `Request` when attempting to render the rerouted route. The creation of this new `Request` will vary based on the signature used. | ||
|
||
- Accepting a `string` allows to quickly reroute to a URL without too much hassle. When using a `string`, Astro will create a new `Request` with the new URL, and it will inherit all the data from the previous request. | ||
> Astro won't do any particular check on the string. For example, it won't check for trailing slashes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it call matchRoute
internally? I'm pretty sure that code does check trailing slash rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internally, we use route.pattern.test
. pattern
is the path-to-regex. Does this regex check for trailing slashes? If so I can omit the paragraph
We should figure out what happens if there are cycles; for example if |
In my early prototype, I was able to detect loops. I added a paragraph for that here |
Let's say you had a middleware stack like this:
Given that |
That's right, I updated the proposal to better explain the API and how |
The commit |
Summary
Links