Fix URI encoding to preserve RFC 3986 unreserved characters in Aliyun signature#12
Merged
daflyinbed merged 6 commits intoaliyunfrom Jan 18, 2026
Merged
Conversation
Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com>
Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com>
Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com>
…er explanations Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix encoding issues in canonicalization functions
Fix URI encoding to preserve RFC 3986 unreserved characters in Aliyun signature
Jan 17, 2026
Collaborator
|
@copilot 不对 直接在NON_ALPHANUMERIC上add我提到的几个要无视的字符 |
Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com>
Contributor
Author
daflyinbed
added a commit
that referenced
this pull request
Jan 19, 2026
…liyun signature (#12) * Initial plan * Fix URI encoding to preserve unreserved characters (-, _, ., ~) Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com> * Improve documentation comment for FRAGMENT encoding set Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com> * Add test case for path separator preservation in URI canonicalization Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com> * Enhance documentation for FRAGMENT encoding set with detailed character explanations Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com> * Use NON_ALPHANUMERIC.remove() to exclude unreserved characters Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: daflyinbed <21363956+daflyinbed@users.noreply.github.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.
The Aliyun signature module was incorrectly percent-encoding RFC 3986 unreserved characters (
-,_,.,~) in URI paths and query strings, causing signature mismatches with the Aliyun API.Changes
UNRESERVEDencoding set by removing unreserved characters fromNON_ALPHANUMERICper RFC 3986canonicalize_uri()to preserve-_.~in path segmentsbuild_canonical_query_string()to preserve-_.~in query keys and valuesExample
Before:
After:
Implementation
The
UNRESERVEDencoding set is created by removing the four unreserved punctuation marks fromNON_ALPHANUMERIC:Path separators (
/) are preserved by splitting before encoding segments.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.