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

register server_fn first to allow for wildcard Route path #2435

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

sify21
Copy link
Contributor

@sify21 sify21 commented Mar 16, 2024

It's quite common to have a NotFound page with a wildcard path like this

<Routes>
    ...
    <Route path="*any" view=NotFound>
</Routes>

In ssr mode, most servers do a first match win approach, so we should register server functions before view routes, or else a wildcard route would block all api requests.

Fix: https://discord.com/channels/1031524867910148188/1218508054442545185

It's normal to have a `NotFound` page with a wildcard path like this
```
<Routes>
    ...
    <Route path="*any" view=NotFound>
</Routes>
```
In `ssr` mode, most servers do a `first match win` approach, so we
should register server functions before view routes, or else a wildcard
route would block all api requests.

https://discord.com/channels/1031524867910148188/1218508054442545185

Signed-off-by: 司芳源 <[email protected]>
@benwis
Copy link
Contributor

benwis commented Mar 19, 2024

LGTM, thanks for the PR!

@benwis benwis merged commit 104c09f into leptos-rs:main Mar 19, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants