-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Berry webserver: allow to content_send bytes #21479
Conversation
Very simple demo to download the files from the root folder "/" in a HTML page:
|
Nice that it seems to be possible now, since #15573 |
I read back my comment from this PR. We need to check that the underlying implementation does not convert to String anymore |
Part of the context is also the not-really-documented Of course, that's not really equivalent to having Berry code able to directly serve binary data, which in some cases can be quite handy instead of needing to write such data to the file system first. Anyway, if the |
Description:
This small addition makes it possible to serve arbitrary data like images or any other file with binary data.
Typically prepended with a call to content_open to declare the MIME type:
Longer demo in the comments.
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass