Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Incorrect parsing of percent encoded strings #32

Open
1 of 4 tasks
baseplate-admin opened this issue Jan 4, 2025 · 0 comments
Open
1 of 4 tasks

Bug: Incorrect parsing of percent encoded strings #32

baseplate-admin opened this issue Jan 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@baseplate-admin
Copy link
Contributor

Description

So basically when i am executing the following code, it results in

[('info_hash=%0dA%f0%1d%f5R%ba%a3%e0%c0t%bb%87b%0b%82%87%fd%89n', ''), ('peer_id', '-qB5030-!k5xcyS5Fny8'), ('port', '27442'), ('uploaded', '0'), ('downloaded', '0'), ('left', '0'), ('corrupt', '0'), ('key', '6F7CD0CB'), ('event', 'started'), ('numwant', '200'), ('compact', '1'), ('no_peer_id', '1'), ('supportcrypto', '1'), ('redundant', '0')]

but it should be:

[('info_hash', '%0dA%f0%1d%f5R%ba%a3%e0%c0t%bb%87b%0b%82%87%fd%89n'), ('peer_id', '-qB5030-!k5xcyS5Fny8'), ('port', '27442'), ('uploaded', '0'), ('downloaded', '0'), ('left', '0'), ('corrupt', '0'), ('key', '6F7CD0CB'), ('event', 'started'), ('numwant', '200'), ('compact', '1'), ('no_peer_id', '1'), ('supportcrypto', '1'), ('redundant', '0')]

URL to code causing the issue

No response

MCVE

from fast_query_parsers import parse_query_string
# The encoded string
encoded_string = b"info_hash=%0dA%f0%1d%f5R%ba%a3%e0%c0t%bb%87b%0b%82%87%fd%89n&peer_id=-qB5030-!k5xcyS5Fny8&port=27442&uploaded=0&downloaded=0&left=0&corrupt=0&key=6F7CD0CB&event=started&numwant=200&compact=1&no_peer_id=1&supportcrypto=1&redundant=0"

# Extract the 'info_hash' value
info_hash_encoded = parse_query_string(encoded_string,'&')


# Print the result
print(info_hash_encoded)

Steps to reproduce

No response

Screenshots

image

Logs

No response

Package Version

1.0.3

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)
@baseplate-admin baseplate-admin added the bug Something isn't working label Jan 4, 2025
@baseplate-admin baseplate-admin changed the title Bug: <title> Bug: Incorrect parsing of percent encoded strings Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant