Skip to content

fix(api-gateway): Remove Transfer-Encoding header on /cubesql error r…#10455

Merged
ovr merged 1 commit intomasterfrom
fix/issue-10450
Mar 3, 2026
Merged

fix(api-gateway): Remove Transfer-Encoding header on /cubesql error r…#10455
ovr merged 1 commit intomasterfrom
fix/issue-10450

Conversation

@ovr
Copy link
Member

@ovr ovr commented Mar 3, 2026

…esponses, fix #10450

The /cubejs-api/v1/cubesql endpoint sets Transfer-Encoding: chunked for streaming responses. When an error occurs before streaming begins, the error handler calls res.json() which adds Content-Length. Having both headers violates RFC 9112 and causes Node.js 22+ fetch() to reject with HPE_UNEXPECTED_CONTENT_LENGTH.

…esponses, fix #10450

The /cubejs-api/v1/cubesql endpoint sets Transfer-Encoding: chunked for
streaming responses. When an error occurs before streaming begins, the
error handler calls res.json() which adds Content-Length. Having both
headers violates RFC 9112 and causes Node.js 22+ fetch() to reject with
HPE_UNEXPECTED_CONTENT_LENGTH.

Remove the Transfer-Encoding header in the catch block before sending
the JSON error response.
@ovr ovr requested a review from a team as a code owner March 3, 2026 14:27
@github-actions github-actions bot added the javascript Pull requests that update Javascript code label Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.64%. Comparing base (c08fec7) to head (b1f6a2e).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
packages/cubejs-api-gateway/src/gateway.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10455      +/-   ##
==========================================
- Coverage   57.64%   57.64%   -0.01%     
==========================================
  Files         222      222              
  Lines       17393    17394       +1     
  Branches     3562     3562              
==========================================
  Hits        10027    10027              
- Misses       6828     6829       +1     
  Partials      538      538              
Flag Coverage Δ
cube-backend 57.64% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ovr ovr merged commit 1b4f137 into master Mar 3, 2026
38 checks passed
@ovr ovr deleted the fix/issue-10450 branch March 3, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/cubejs-api/v1/cubesql error responses send both Content-Length and Transfer-Encoding headers

2 participants