We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When returning a ReadableStream from an Elysia route, .body is the ReadableStream while .stream is undefined.
.body
.stream
The code in question is:
https:/Gusb3ll/elysia-compression/blob/main/src/index.ts#L76C42-L76C42
Not only does the stream not compress, but the response is hijacked to be {} instead of the html.
{}
To fix, I inserted:
const stream = ctx.response?.stream ?? ctx.response?.body;
Edit:
I have never seen res.stream before. Is this in the web standard or is this something added by Elysia or Bun?
res.stream
Note the route looks something like:
app.get('/', ()=> new Response( new ReadableStream({ start(controller) { controller.enqueue('<html></html>') controller.close() } }), { headers: { 'Content-Type': 'text/html;charset=UTF-8' } } ))
The text was updated successfully, but these errors were encountered:
Gusb3ll
No branches or pull requests
When returning a ReadableStream from an Elysia route,
.body
is the ReadableStream while.stream
is undefined.The code in question is:
https:/Gusb3ll/elysia-compression/blob/main/src/index.ts#L76C42-L76C42
Not only does the stream not compress, but the response is hijacked to be
{}
instead of the html.To fix, I inserted:
Edit:
I have never seen
res.stream
before. Is this in the web standard or is this something added by Elysia or Bun?Note the route looks something like:
The text was updated successfully, but these errors were encountered: