-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Resolves #5045: Trim slashes to prevent base path resolution issues in web #5049
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
Conversation
ealmloff
left a comment
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.
Thanks! Could you move this normalization to when DIOXUS_ASSET_ROOT is set instead of when it is read?
Then we don't need to rerun it every time we read the base path. It could also be in the head instead of the env var depending on the platform.
Sure can! |
…s in web" This reverts commit 480cd48.
DIOXUS_ASSET_ROOT (cli arg, dioxus toml, or env var) it will be normalized when used.
|
This approach covers all three ways (cli, toml, env var) the base_path can be set. In fact it is likely true that this code in request.rs could be removed. However, I was unsure of the ramifications of doing so. Another point to note. Simply modifying where we internally set |
The CLI always either writes |
I apologize for the confusion here. I assumed that the environment variable was accessible from the comments in the code. I'll revert these and make that change. |
…OOT as this environment variable is not meant for public consumption.
Pull out trimming into a method
ealmloff
left a comment
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.
Much better, thanks!
Normalize the base path when set to
/to prevent routing and asset resolution errors in web. This resolves #5045.