Fix three Windows path handling bugs in URI conversion#233
Open
throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Open
Fix three Windows path handling bugs in URI conversion#233throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
throb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
1. posix_path_to_uri: reverse_remap_file_path() was called with the
original `path` argument instead of the processed `p`, discarding
any relative-to-absolute path resolution done earlier in the function.
2. uri_to_posix_path: drive letter regex only matched uppercase [A-Z],
so a URI with a lowercase drive letter (e.g. /c:/Users/...) would
retain the leading slash, producing an invalid Windows path.
3. posix_path_to_uri: file URIs were built with host("localhost"),
producing file://localhost/C:/... which can cause parsing mismatches
on deserialization. The standard form file:///C:/... (empty host) is
more portable. The existing code comments (lines 595-599) already
noted that localhost doesn't work with some readers like ffmpeg.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
posix_path_to_uri():reverse_remap_file_path()was called with the originalpathargument instead of the processedp, silently discarding any relative-to-absolute path resolutionuri_to_posix_path(): drive letter regex only matched uppercase[A-Z], so a URI with a lowercase drive letter retained the leading slash, producing an invalid pathposix_path_to_uri(): file URIs were built withhost("localhost")producingfile://localhost/C:/...which causes parsing mismatches on deserialization. Switched tohost("")for the standardfile:///C:/...form. The existing code comments (lines 595-599) already note that localhost doesn't work with some readers like ffmpegAll three are one-line fixes in
src/utility/src/helpers.cpp.Test plan
c:/vsC:/)forward_remap_file_path/reverse_remap_file_path)#ifdef _WIN32, the third is platform-neutral)🤖 Generated with Claude Code