mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Fixes #70086 and #64864 (partially) ### What? When user wants to override for certain headers such as `content-type` or `cache-control` via `next.config` file or through middleware, nextjs sends multiple header values by combining the user's headers with its own default values for such headers. An example is demonstrated here: https://github.com/user-attachments/assets/7b38331b-9137-485d-9285-d0b0d0e1e5ac ### Why? Duplicate header values are a problem. ### How? Maintaining a list of headers which cannot have duplicate values, and then checking if the user has overridden any of those headers. If so, user overrides are respected and sent over. Demonstration of the correct behaviour after this fix: Using `next.config` file: https://github.com/user-attachments/assets/65e2aafb-dffc-47f4-bfcf-cf26a66865db Using `middleware`: https://github.com/user-attachments/assets/67636145-10eb-4504-ad78-800c1307c550 --------- Co-authored-by: JJ Kasper <[email protected]>
7 lines
96 B
JavaScript
7 lines
96 B
JavaScript
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
const nextConfig = {}
|
|
|
|
module.exports = nextConfig
|