Repository navigation
REST requests: decode any %XX escape, once - #55
Merged
Merged
Conversation
unencodeHTTPChars replaced a fixed list of printable escapes one after another, so %27
became ^ (not '), %25 was decoded before the others ("%2526" gave "&"), and control
characters (%0D, %0A, %03), %40 and UTF-8 were not decoded - MicroPython REPL input sent
with encodeURIComponent() arrived with escapes left in it. It is now a single-pass
decoder of any %XX (either hex case); a % that isn't an escape, and %00, are kept.
test_rest_api_params (Linux unit tests) checks the decoding and that query values are
still trimmed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…start Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # linux_unit_tests/Makefile # linux_unit_tests/README.md
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.
unencodeHTTPCharsreplaced a fixed list of printable escapes one after another, so:%27became^(not')%25was decoded before the others (%2526gave&)%0D,%0A,%03),%40and UTF-8 were not decodedAs a result, MicroPython REPL input sent with
encodeURIComponent()arrived with escapes left in it.It is now a single-pass decoder of any
%XX(either hex case). A%that isn't an escape, and%00, are kept.Also corrects the
devman/setrolecomment:save=1keeps the role over a restart.Tests:
test_rest_api_params(Linux unit tests) checks the decoding and that query values are still trimmed;RestAPIEndpointManager_test.cppcovers it in the on-target unit tests.Related: robdobsn/raftjs
fix/upy-console-input-encoding.🤖 Generated with Claude Code