[PR #1346] [CLOSED] api/stream: add Transfer-Encoding header to tunnel responses #28045

Closed
opened 2026-06-21 17:52:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/imputnet/cobalt/pull/1346
Author: @andresperezl
Created: 6/12/2025
Status: Closed

Base: mainHead: tunnel-transfer-encoding


📝 Commits (1)

  • c261444 api/stream: add Transfer-Encoding header to tunnel responses

📊 Changes

2 files changed (+6 additions, -1 deletions)

View changed files

📝 api/src/core/api.js (+2 -1)
📝 api/src/stream/types.js (+4 -0)

📄 Description

For HTTP/1.1 when the length of the content isn't known, you must send the header Transfer-Encoding: chunked, so the client knows that it needs to process the response in parts (chunks). This header is deprecated in HTTP/2, and maybe not neccessary when using a proxy (nginx, haproxy, etc), but neccesary when accesing cobalt directly. https://en.wikipedia.org/wiki/Chunked_transfer_encoding

When the header is not present, downloading files from the tunnel will result is a 0 bytes file, as client will follow the Content-Length header, which is set to 0


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/imputnet/cobalt/pull/1346 **Author:** [@andresperezl](https://github.com/andresperezl) **Created:** 6/12/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tunnel-transfer-encoding` --- ### 📝 Commits (1) - [`c261444`](https://github.com/imputnet/cobalt/commit/c26144403c78d54b28f605ea8421229ac51b2a0e) api/stream: add Transfer-Encoding header to tunnel responses ### 📊 Changes **2 files changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `api/src/core/api.js` (+2 -1) 📝 `api/src/stream/types.js` (+4 -0) </details> ### 📄 Description For HTTP/1.1 when the length of the content isn't known, you must send the header `Transfer-Encoding: chunked`, so the client knows that it needs to process the response in parts (chunks). This header is deprecated in HTTP/2, and maybe not neccessary when using a proxy (nginx, haproxy, etc), but neccesary when accesing cobalt directly. https://en.wikipedia.org/wiki/Chunked_transfer_encoding When the header is not present, downloading files from the tunnel will result is a 0 bytes file, as client will follow the `Content-Length` header, which is set to 0 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-21 17:52:19 -05:00
Sign in to join this conversation.