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

request: use the original_uri, not the request parts uri #16

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

mjhoy
Copy link
Owner

@mjhoy mjhoy commented Apr 17, 2024

This fixes an issue when using nested routers with axum_inertia. The client will
only know about the original uri, not how the routers are structured internally,
so we want to return the "external-facing" urls in the props.

This fixes an issue when using nested routers with axum_inertia. The client will
only know about the original uri, not how the routers are structured internally,
so we want to return the "external-facing" urls in the props.
async fn from_request_parts(mut parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
let original_uri = OriginalUri::from_request_parts(&mut parts, state)
.await
.unwrap_or_else(|e| match e {});
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somewhat awkward way to deal with result types with an Infallible error

@mjhoy mjhoy merged commit 82bffa8 into main Apr 17, 2024
5 checks passed
@mjhoy mjhoy deleted the use-original-uri branch April 17, 2024 13:07
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.

1 participant