-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Percent/URL Decoding Support #1831
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
Conversation
bef24cd
to
7a0d3f5
Compare
7e1eefd
to
5ebf6a7
Compare
b4ddd81
to
b62dba3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I'm convinced @bplaxco is some kind of wizard or time traveling AI
} | ||
|
||
segments = append(segments, segment) | ||
logging.Debug().Msgf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this debug message
* Add initial percent decoding support * Refactor multi encoding support * Add detect tests to confirm positions * Avoid a few extra passes during decoding * Do multiple passes for finding encodings re * Fix issue with overlapping encodings when doing separate passes
if err == nil && isPrintableASCII(decodedValue) { | ||
return string(decodedValue) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bplaxco Hypothetically, couldn't there be chunks that have both standard and url encoding? I guess since this is recursive it should catch both cases?
Description:
Add percent decoding (aka URL decoding) support.
Goals:
[1]: For example:
This
aGVsbG8sIHdvcmxkIQ%3D%3D%0A
should decode first toaGVsbG8sIHdvcmxkIQ==
and thenhello, world!
. But this'hello%2C%20world%21 aGVsbG8sIHdvcmxkIQ==
shouldn't need two passes to to be fully decoded.TODO
detect_test.go
(make sure to test multiple levels and that the parent child relationship works properly with segments)Checklist: