Skip to content

Allow sending raw bytes in the response #34

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

Closed
wants to merge 0 commits into from
Closed

Conversation

deshipu
Copy link
Contributor

@deshipu deshipu commented Jan 11, 2023

We now only encode the body if it has an encode method, which usually means it's a string. This allows passing bytes, bytearray or memoryview.

I also changed the logic for sending a chunk, that avoids copying the data unnecessarily. I believe this also fixes a bug, where the size of unencoded chunk was sent, in characters, instead of encoded size, in bytes.

@deshipu
Copy link
Contributor Author

deshipu commented Jan 11, 2023

This fixes #33

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.

1 participant