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

Detect a non-binary body better #262

Closed
wants to merge 2 commits into from

Conversation

mgirlich
Copy link
Collaborator

@mgirlich mgirlich commented Aug 3, 2023

Closes #91.
The type resp. content type of the request/response body provides a good indicator whether the body contains binary data or not.

R/req-options.R Outdated Show resolved Hide resolved
@@ -7,7 +7,7 @@
-> Accept-Encoding: gzip
-> Content-Length: 17
->
>> This is some text
>> 17 bytes of binary data
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the check on any(x > 128). But I guess this is fine, in particular if also the content type header is consulted in a future PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh, I didn't realise we weren't using the content type yet. How hard would it be to do that?

@hadley
Copy link
Member

hadley commented Aug 26, 2023

I'm less confident that we can get this to work without a bunch of effort — won't we need to manually parse the headers in order to figure out the content type?

@hadley
Copy link
Member

hadley commented Jan 16, 2024

Closing in favour of #427

@hadley hadley closed this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rethink binary detection in body
2 participants