450552ddba
## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` Fixes #30430 There's some more discussion in the issue, but in summary: - web `Headers` implementation combines all header values with `', '` - For `Set-Cookie` headers, you're supposed to set them as separate values, not combine them - web `Headers` forbids the use of `Cookie`, `Set-Cookie` and some more headers, so they don't have custom implementation for those, and still joins them with `,` - We currently just split them using `split(',')`, but this breaks when the header contains a date (expires, max-age) that also includes a `,` I used this method to split the Set-Cookie header properly: https://www.npmjs.com/package/set-cookie-parser#splitcookiestringcombinedsetcookieheader as suggested [here](https://github.com/whatwg/fetch/issues/973#issuecomment-559678813) I didn't add it as a dependency, since we only needed that one method and I wasn't sure what the process is for adding dependencies, so I just added the method in the middleware utils |
||
---|---|---|
.. | ||
dev | ||
lib | ||
web | ||
accept-header.ts | ||
api-utils.ts | ||
config-shared.ts | ||
config-utils.ts | ||
config.ts | ||
crypto-utils.ts | ||
denormalize-page-path.ts | ||
font-utils.ts | ||
get-page-files.ts | ||
get-route-from-entrypoint.ts | ||
htmlescape.ts | ||
image-config.ts | ||
image-optimizer.ts | ||
incremental-cache.ts | ||
load-components.ts | ||
next-server.ts | ||
next.ts | ||
node-polyfill-fetch.js | ||
normalize-page-path.ts | ||
optimize-amp.ts | ||
render-result.ts | ||
render.tsx | ||
require.ts | ||
response-cache.ts | ||
router.ts | ||
send-payload.ts | ||
serve-static.ts | ||
utils.ts |