Skip to content

fix: freeze default response headers#1227

Merged
pi0 merged 2 commits intomainfrom
fix/header-sideeffect
Oct 21, 2025
Merged

fix: freeze default response headers#1227
pi0 merged 2 commits intomainfrom
fix/header-sideeffect

Conversation

@pi0
Copy link
Copy Markdown
Member

@pi0 pi0 commented Oct 21, 2025

As a result of #1214 (which was required to fix memory leak issues related to bun and TSS), we introduced an implicit behavior of modifying returned response.headers.

When combined with the default error handler, we were returning a response with a shared JSON header, which, in fact, was causing leaks.

While fix is simply cloning headers for errorResponse internal util, this PR makes internals more secure against any possible similar case in the future.

@pi0 pi0 force-pushed the fix/header-sideeffect branch from a464d7b to f6b8af9 Compare October 21, 2025 17:49
@pi0 pi0 merged commit 5911ecb into main Oct 21, 2025
8 of 9 checks passed
@pi0 pi0 deleted the fix/header-sideeffect branch October 21, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant