mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
Fixes a stack overflow crash that occurred when passing a function as the second argument (ResponseInit) to the Response constructor. The issue was that the constructor checked `isObject()` which returns true for functions, and then proceeded to call `Init.init()` which would attempt to read properties from the function. This could cause infinite recursion in certain edge cases. The fix adds an explicit check to reject callable objects before processing them as ResponseInit, throwing a proper TypeError instead of causing a stack overflow.