begoon
begoon3mo ago

Transfer-Encoding: chunked

Alas, my question about "Transfer-Encoding: chunked" on SO did not go anywhere. Any advice on the matter from great minds here? https://stackoverflow.com/questions/78720322/why-i-see-chunk-sizes-as-text-in-browser-when-streaming-http-with-transfer-enco
Stack Overflow
Why I see chunk sizes as text in browser when streaming HTTP with "...
I am trying to stream HTTP using "Transfer-Encoding": "chunked". Here is the code for Deno (deno run -A --watch main.ts): function generateStream(): ReadableStream<Uint8Array...
1 Reply
Deno AI Helper
Deno AI Helper3mo ago
I'm sorry to hear that your question on Stack Overflow didn't receive the response you were hoping for. Unfortunately, I wasn't able to find the answer to your question about "Transfer-Encoding: chunked" in the official Deno documentation. However, based on the information you've provided, it seems like you're encountering an issue where chunk sizes are visible as text in the browser when streaming HTTP with "Transfer-Encoding: chunked". Without seeing the specific code or context, it's difficult to provide a precise solution, but here are a couple of general points to consider: 1. Ensure that the HTTP response headers are correctly set. The Transfer-Encoding: chunked header should be part of the response headers, and there should not be a Content-Length header set, as these two headers are mutually exclusive for a given response. 2. Verify that the chunks are being formatted correctly. Each chunk should start with the size of the chunk in hexadecimal format followed by \r\n, then the chunk data itself, and another \r\n. The end of the message is indicated by a zero-length chunk (0\r\n\r\n). Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. If you continue to experience issues, you might want to seek assistance from the Deno community or revisit Stack Overflow with additional details that could help others understand and address your problem.