Minimal URI escaping #14
Draft
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.
Warning: This is based on a not-yet-concluded specification precision suggestion. You might not want to merge this until the discussion there is concluded; this serves to illustrate, and as a reference implementation of the proposed canonicalization.
There is some over-escaping happening currently before the MD5 hashing; in particular, a colon (':') is escaped without need.
While discussion is ongoing at FDO and there may be follow-ups on the IETF side, I think that what is proposed here is what should be the canonical encoding.
Concrete changes:
pcharin RFC3986, and imported from RFC8089 via thepath-absoluterule../prefix is introduced iff there is a colon in the relative reference. (Otherwise URI parsing would give completely different results when parsed back).