You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Strange result with set-cookie header of undici.fetch #1328
Result of set-cookie, Set-cookie, and sEt-CoOkIe header value should be same, but undici.fetch has different result.
Reproducible By
const{ fetch }=require('undici');constresponse=awaitfetch('https://maple.gg');console.log(response.headers);// has set-cookieconsole.log(response.headers.get('set-cookie'));// undefinedconsole.log(response.headers.get('Set-cookie'));// some cookie key and valueconsole.log(response.headers.get('sEt-CoOkIe'));// some cookie key and value
Activity
RafaelGSS commentedon Apr 9, 2022
@cjh980402 which
undiciversion are you using?cjh980402 commentedon Apr 9, 2022
@RafaelGSS I use undici 5.0.0.
KhafraDev commentedon Apr 13, 2022
set-cookieis a forbidden header-name so it should be removed entirely (this is similar behavior with browser)however
gettinga non-existent header should return null, not undefined.edit: fixed both bugs and will make a PR soon.
aeharding commentedon May 23, 2022
set-cookie is a forbidden header-name so it should be removed entirely (this is similar behavior with browser)@KhafraDev if this is true, it seems like a case of a spec being written in the context of the browser, and not node.
Is there any chance of this being reverted? This change makes the fetch API not usable for me.
KhafraDev commentedon May 23, 2022
Reverted? Probably not. However I'm willing to make a PR once a decision has been made on how to handle cookies in undici/node.