ImageResponse
not handling (merging) headers
option correctly
#67641
Labels
bug
Issue was opened via the bug report template.
ImageResponse
not handling (merging) headers
option correctly
#67641
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/jovial-tree-fwk39m?file=/app/page.tsx:4,62&layout=%7B%22sidebarPanel%22%3A%22EXPLORER%22%2C%22rootPanelGroup%22%3A%7B%22direction%22%3A%22horizontal%22%2C%22contentType%22%3A%22UNKNOWN%22%2C%22type%22%3A%22PANEL_GROUP%22%2C%22id%22%3A%22ROOT_LAYOUT%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22UNKNOWN%22%2C%22direction%22%3A%22vertical%22%2C%22id%22%3A%22clyg9bptg00063j6kfzrtt3fc%22%2C%22sizes%22%3A%5B70%2C30%5D%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22EDITOR%22%2C%22direction%22%3A%22horizontal%22%2C%22id%22%3A%22EDITOR%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL%22%2C%22contentType%22%3A%22EDITOR%22%2C%22id%22%3A%22clyg9bptg00023j6k3w4rphuo%22%7D%5D%7D%2C%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22SHELLS%22%2C%22direction%22%3A%22horizontal%22%2C%22id%22%3A%22SHELLS%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL%22%2C%22contentType%22%3A%22SHELLS%22%2C%22id%22%3A%22clyg9bptg00043j6kmh0go18l%22%7D%5D%2C%22sizes%22%3A%5B100%5D%7D%5D%7D%2C%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22DEVTOOLS%22%2C%22direction%22%3A%22vertical%22%2C%22id%22%3A%22DEVTOOLS%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL%22%2C%22contentType%22%3A%22DEVTOOLS%22%2C%22id%22%3A%22clyg9bptg00053j6kuo9qzs1s%22%7D%5D%2C%22sizes%22%3A%5B100%5D%7D%5D%2C%22sizes%22%3A%5B50%2C50%5D%7D%2C%22tabbedPanels%22%3A%7B%22clyg9bptg00023j6k3w4rphuo%22%3A%7B%22tabs%22%3A%5B%7B%22id%22%3A%22clyg9bptg00013j6kpjw6zalf%22%2C%22mode%22%3A%22permanent%22%2C%22type%22%3A%22FILE%22%2C%22filepath%22%3A%22%2FREADME.md%22%2C%22state%22%3A%22IDLE%22%7D%2C%7B%22id%22%3A%22clyga1kel00023j6jbbv43sut%22%2C%22mode%22%3A%22permanent%22%2C%22type%22%3A%22FILE%22%2C%22initialSelections%22%3A%5B%7B%22startLineNumber%22%3A4%2C%22startColumn%22%3A62%2C%22endLineNumber%22%3A4%2C%22endColumn%22%3A62%7D%5D%2C%22filepath%22%3A%22%2Fapp%2Fpage.tsx%22%2C%22state%22%3A%22IDLE%22%7D%5D%2C%22id%22%3A%22clyg9bptg00023j6k3w4rphuo%22%2C%22activeTabId%22%3A%22clyga1kel00023j6jbbv43sut%22%7D%2C%22clyg9bptg00053j6kuo9qzs1s%22%3A%7B%22id%22%3A%22clyg9bptg00053j6kuo9qzs1s%22%2C%22tabs%22%3A%5B%7B%22type%22%3A%22UNASSIGNED_PORT%22%2C%22port%22%3A3000%2C%22id%22%3A%22clyg9yq6t00es3j6k6oy35ccs%22%2C%22mode%22%3A%22permanent%22%2C%22path%22%3A%22%2F%22%7D%5D%2C%22activeTabId%22%3A%22clyg9yq6t00es3j6k6oy35ccs%22%7D%2C%22clyg9bptg00043j6kmh0go18l%22%3A%7B%22id%22%3A%22clyg9bptg00043j6kmh0go18l%22%2C%22tabs%22%3A%5B%7B%22id%22%3A%22clyg9bptg00033j6k5zx5lc4f%22%2C%22mode%22%3A%22permanent%22%2C%22type%22%3A%22TASK_LOG%22%2C%22taskId%22%3A%22dev%22%7D%5D%2C%22activeTabId%22%3A%22clyg9bptg00033j6k5zx5lc4f%22%7D%7D%2C%22showDevtools%22%3Atrue%2C%22showShells%22%3Atrue%2C%22showSidebar%22%3Atrue%2C%22sidebarPanelSize%22%3A15%7D
To Reproduce
npm run build && npm run start
/
ImageResponse
will have a bogusCache-Control
headerpublic, immutable, no-transform, max-age=31536000, max-age=3600, s-maxage=3600
Current vs. Expected behavior
Currently,
ImageResponse
merges theheaders
options while keeping all default headers instead of respecting the explicit overwrite from the developer. E.g., "{ headers: { 'Cache-Control': 'max-age=3600, s-maxage=3600' } }becomes
Cache-Control: public, immutable, no-transform, max-age=31536000, max-age=3600, s-maxage=3600`.As an expected behavior, "{ headers: { 'Cache-Control': 'max-age=3600, s-maxage=3600' } }
should become
Cache-Control: max-age=3600, s-maxage=3600`.Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 4102 Available CPU cores: 2 Binaries: Node: 20.9.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: 8.10.2 Relevant Packages: next: 15.0.0-canary.62 // Latest available version is detected (15.0.0-canary.62). eslint-config-next: N/A react: 19.0.0-rc-6f23540c7d-20240528 react-dom: 19.0.0-rc-6f23540c7d-20240528 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed)
Additional context
No response
The text was updated successfully, but these errors were encountered: