fix: views:// URLs without folders fail to load#339
Open
AhmedNAgy25 wants to merge 1 commit intoblackboardsh:mainfrom
Open
fix: views:// URLs without folders fail to load#339AhmedNAgy25 wants to merge 1 commit intoblackboardsh:mainfrom
AhmedNAgy25 wants to merge 1 commit intoblackboardsh:mainfrom
Conversation
When using views:// URLs without folder components (e.g., views://home.html), WebView/WebView2 normalizes the URL by adding a trailing slash, resulting in views://home.html/. This caused file loading to fail. Fixes blackboardsh#329
Author
|
can any maintainer give a look here please |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When setting up a view directly in the views folder (e.g.
views://home.html) instead of a subfolder, the HTML file fails to load.The error log shows:
Looks like WebView2 adds a trailing slash when normalizing URLs without a path component, so it tries to load
home.html/as a folder instead of a file.Fixed by stripping trailing slashes from the path before attempting to load the file. This affects path handling on all three platforms.
Fixes #329