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

Limit amount of data sent each time #40

Open
vitorbaptista opened this issue Nov 16, 2016 · 0 comments
Open

Limit amount of data sent each time #40

vitorbaptista opened this issue Nov 16, 2016 · 0 comments

Comments

@vitorbaptista
Copy link
Owner

As commented on #39 by @devanlai:

An easy way to trip this case is to run something that dumps lots of data, like dmesg.

It's also possible to avoid generating the 413 Request Entity Too Large error in the first place by limiting the amount of data read and sent in a single post request. For example, in stream_file:

max_post_size = 300 * 1024
# Url-encoding control characters = 3/1 overhead
# Base64 encoding = 4/3 overhead
# Worst case encoded size is 4x the original size
# Also allow some overhead for the other json fields
max_unencoded_size = (max_post_size // 4) - 64
data = f.read(max_unencoded_size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant