-
Notifications
You must be signed in to change notification settings - Fork 179
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
feat: add stream pipe response #68
Conversation
Very nice thought. However, it looks like this adds a hard dependency on node, which we would want to avoid. Maybe something other than |
Hum, that's true. Using deno or web workers would rely on ReadableStream which is the new standard. This uses the former node streams. Instead we can rely on the new stream implementation, so we can check over The caveat is that the feature is new and require node v16, what do you think? Edit: unfortunately we can not use pipeTo on http responses for now, even with node 17 |
This allows to pipe readable streams returned from middlewares!
I also set the default
content-type
header used for buffers and streams totext/html
assuming most of time it would be used to pipe html response. We could useapplication/octet-stream
instead, but it would require to explicitly setcontent-type
on each responses.