Fix file:// URI parsing#1601
Merged
Merged
Conversation
A previous change to fix #1344 to handle # characters in literal no-scheme paths broke file:// scheme URI parsing by including the entire literal URI in the file path, which breaks encoded paths (like those with spaces) and URIs with non-path data (such as query parameters). This partially reverts the prior fix, so that # is not supported in file:// URIs, requiring the user to either use a no-scheme URI or encode the path, as # is reserved in URIs for fragment declarations. Fixes: #1513 Test: FileUriMapperTest#ignoresAfterPathCorrectly Test: FileUriMapperTest#decodesEncodedPath
colinrtwhite
approved these changes
Jan 30, 2023
Member
colinrtwhite
left a comment
There was a problem hiding this comment.
Thanks for fixing this and adding regression tests! It's too bad we can't support # in file URIs, but makes sense given the spec (as you mentioned).
colinrtwhite
added a commit
that referenced
this pull request
Feb 21, 2023
* main: Update the baseline files. (#1625) Always invoke mkdir when creating DiskCache. (#1626) Update dependency gradle to v8.0.1 (#1623) Fix DiskCache maxSize calculation (#1619) (#1620) Update plugin binaryCompatibility to v0.13.0 (#1621) Update dependency gradle to v8 (#1618) Update dependency androidx.profileinstaller:profileinstaller to v1.3.0-beta01 (#1613) Update Kotlin to 1.8.10. (#1614) Update dependency androidx.exifinterface:exifinterface to v1.3.6 (#1612) Update dependency androidx.appcompat:appcompat-resources to v1.6.1 (#1611) Migrate to collectStableBaselineProfile. (#1607) Update dependency com.android.tools.build:gradle to v7.4.1 (#1608) Fix file:// URI parsing (#1601) Update dependency com.vanniktech:gradle-maven-publish-plugin to v0.24.0 (#1603) Update dependency com.google.android.material:material to v1.8.0 (#1600) Update Kotlin to 1.8. (#1597) Update dependency com.vanniktech:gradle-maven-publish-plugin to v0.23.2 (#1596) Update dependency com.android.tools.build:gradle to v7.4.0 (#1594)
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.
A previous change to fix #1344 to handle # characters in literal no-scheme paths broke file:// scheme URI parsing by including the entire literal URI in the file path, which breaks encoded paths (like those with spaces) and URIs with non-path data (such as query parameters).
This partially reverts the prior fix, so that # is not supported in file:// URIs, requiring the user to either use a no-scheme URI or encode the path, as # is reserved in URIs for fragment declarations.
Fixes: #1513
Test: FileUriMapperTest#ignoresAfterPathCorrectly
Test: FileUriMapperTest#decodesEncodedPath