You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The chunked response handling in std/http seems to be very broken. When you give it a Reader, it's supposed to send a chunked response, but it throws an error after only a few megabytes of data.
Below is a script to reproduce this. If image.jpg is very small, it'll work fine. Interestingly, the amount of data that actually gets sent to the client seems to be somewhat erratic. Sometimes I get ~4 megabytes, sometimes I get < 2 megabytes. Maybe backpressure isn't working properly?
import*ashttpfrom'https://deno.land/std@v0.56.0/http/server.ts';constrespond=async(request: http.ServerRequest)=>{constfile=awaitDeno.open('./image.jpg');awaitrequest.respond({body : file,// works if file is very small, but throws an error if it's a bit large (>4MB ???)status : 200});file.close();};forawait(constrequestofhttp.serve({port : 3000})){respond(request);}
The chunked response handling in
std/http
seems to be very broken. When you give it aReader
, it's supposed to send a chunked response, but it throws an error after only a few megabytes of data.Below is a script to reproduce this. If
image.jpg
is very small, it'll work fine. Interestingly, the amount of data that actually gets sent to the client seems to be somewhat erratic. Sometimes I get ~4 megabytes, sometimes I get < 2 megabytes. Maybe backpressure isn't working properly?Stack trace
Environment
OS: macOS 10.14.6
I am also able to reproduce this on Deno 1.0.5.
The text was updated successfully, but these errors were encountered: