mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
setHeader() stored the caller's array and that led to mutation issues with appendHeader() pushing new values into it. The caller would see values added to that array, and if the array was frozen appendHeader() would throw a TypeError. This fix copies the array value instead so the response instance owns it completely. getHeader() still return the stored array. It also applies the same change to HTTP2 compat api. Fixes: https://github.com/nodejs/node/issues/67526 Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ethan Arrowood <ethan@arrowood.dev> PR-URL: https://github.com/nodejs/node/pull/67528 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>