-
Notifications
You must be signed in to change notification settings - Fork 239
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
Remove br encoding #523
Remove br encoding #523
Conversation
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.
While this might be a viable solution, I think the proper one should be decoding the body it if the header is present, or even better detect br encoding via the initial magic bytes (even though this doesn't seem like the case for brotli). What do you think? <= implemented at projectdiscovery/utils#371
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.
lgtm - not sure it's anymore necessary with projectdiscovery/utils#371
Thanks for the review. Unfortunately, even with projectdiscovery/utils#371, the behavior was non-deterministic. So, that's why I raised this PR /shrug. |
how about using https://pkg.go.dev/net/http#DetectContentType to detect content type manually by magic bytes. If i am not wrong net/http already does this for every request or response |
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.
lgtm !
Proposed changes
Closes #519.
This PR removes
br
encoding from the request as the issue is not always reproducible.Checklist