From c1bf43e4cc34f565089d82f8579e46ea12ae618e Mon Sep 17 00:00:00 2001 From: JeanJPNM <61994401+JeanJPNM@users.noreply.github.com> Date: Thu, 24 Feb 2022 00:52:25 -0300 Subject: [PATCH] [fix] Use headers.raw() on `split_headers` (#4096) * use headers.raw() on `split_headers` * add changeset --- .changeset/three-elephants-breathe.md | 5 +++++ packages/adapter-netlify/src/handler.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/three-elephants-breathe.md diff --git a/.changeset/three-elephants-breathe.md b/.changeset/three-elephants-breathe.md new file mode 100644 index 000000000000..4da4430afc1f --- /dev/null +++ b/.changeset/three-elephants-breathe.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-netlify': patch +--- + +Fix incorrect set-cookie header handling on adapter-netlify diff --git a/packages/adapter-netlify/src/handler.js b/packages/adapter-netlify/src/handler.js index fcf928145ccf..a81c53978d54 100644 --- a/packages/adapter-netlify/src/handler.js +++ b/packages/adapter-netlify/src/handler.js @@ -73,7 +73,8 @@ function split_headers(headers) { headers.forEach((value, key) => { if (key === 'set-cookie') { - m[key] = value.split(', '); + // @ts-expect-error (headers.raw() is non-standard) + m[key] = headers.raw()[key]; } else { h[key] = value; }