-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Response missing body
property
#530
Comments
Web Streams for For now, if you just want to get a const stream = (await response.blob()).stream();
This is a console.log formatting bug where it sometimes adds the |
I think I follow, but just to be sure, you're saying that Appreciate the workaround, but looking for CFW/Deno compatibility. This seems to be the only blocker for my |
Yes.
awesome! |
@Jarred-Sumner It will load the whole request body into a memory, right? |
yes |
@Jarred-Sumner Can I ask unrelated question here? Do you know why Bun.serve starts listening exactly after 4 seconds (Ubuntu 22.04)? Is it a bug? |
It’s an event loop bug. The task to sleep the event loop to wait for the next request needs to happen outside the microtask queue. Right now there is one queue for tasks of all kinda |
Okay, thank you for response. Thank you for your great work! Current workaround for getting a request stream is not suitable for file uploads, so I will wait while Request/Response streams will be implemented |
I think you’ll really like the solution in mind for file uploads. The same
syscall that lets bun serve files at 5.8 GB/s could work for uploading them
(as long as http only, no client-side compression)
https://twitter.com/jarredsumner/status/1506266502088957953?s=21&t=S_xRebD_ZiQyZCpNvGUPtg
…On Sun, Jul 10, 2022 at 3:54 AM Anton Piliugin ***@***.***> wrote:
It’s an event loop bug. The task to sleep the event loop to wait for the
next request needs to happen outside the microtask queue. Right now there
is one queue for tasks of all kinda
Okay, thank you for response. Thank you for your great work! Current
workaround for getting a request stream is not suitable for file uploads,
so I will wait while Request/Response streams will be implemented
—
Reply to this email directly, view it on GitHub
<https://github.com/Jarred-Sumner/bun/issues/530#issuecomment-1179704448>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFNGS4WTVJOHACCUNJ26G3VTKTVHANCNFSM53EPYH6Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Awesome! It will not work for SSL enabled servers? |
`return new Response(Bun.file(file), {headers,status: 200})` https://github.com/Jarred-Sumner/bun/issues/530#issuecomment-1179665319 use https://github.com/lukeed/sirv source code
`return new Response(Bun.file(file), {headers,status: 200})` https://github.com/Jarred-Sumner/bun/issues/530#issuecomment-1179665319 use https://github.com/lukeed/sirv source code
Version
0.1.2
Platform
Darwin MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64
What steps will reproduce the bug?
The
body
property doesn't seem to exist on theResponse
class, which means that an existing Response cannot be cloned (and made mutable) vianew Response(res.body, res)
:How often does it reproduce? Is there a required condition?
Every request
What is the expected behavior?
The entire Response should be cloned into a new, mutable Response instance that includes the original's body content. In this case, the response should be
404
with"hello world"
text body.What do you see instead?
Response is 404 with no body content and
Content-Length: 0
header.Additional information
console output:
The text was updated successfully, but these errors were encountered: