Bug 227739

Summary: Only first set-cookie HTTP header in websocket http response is accepted
Product: WebKit Reporter: Shu Muto <shu.mutow>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: REOPENED ---    
Severity: Normal CC: aakash_jain, achristensen, ap, commit-queue, ggaren, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: iOS 14   
Bug Depends on: 227903    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch achristensen: review?

Description Shu Muto 2021-07-06 23:44:43 PDT
Second and third set-cookie headers do not seem to be processed.
Comment 1 Alexey Proskuryakov 2021-07-07 11:57:00 PDT
Does this still reproduce in iOS 15 beta?

Could you please provide a test page if this is still an issue?
Comment 2 Alex Christensen 2021-07-07 15:21:38 PDT
Created attachment 433084 [details]
Patch
Comment 3 Alex Christensen 2021-07-07 15:22:57 PDT
Here's a test that verifies that this has been fixed in the latest version as well as in the pre-iOS15/Monterey WebSocket implementation.  I haven't verified that it was ever broken, so if it was or still is some other way, please let us know.
Comment 4 Geoffrey Garen 2021-07-07 16:53:26 PDT
Comment on attachment 433084 [details]
Patch

r=me
Comment 5 Shu Muto 2021-07-07 17:26:44 PDT
Thanks for telling me that this issue has been fixed in iOS 15 and creating tests that ensure the fix!
I don't have Mac, so I can not install beta version. Sorry.
Comment 6 EWS 2021-07-07 18:46:14 PDT
Committed r279705 (239497@main): <https://commits.webkit.org/239497@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 433084 [details].
Comment 7 Radar WebKit Bug Importer 2021-07-07 18:47:15 PDT
<rdar://problem/80300158>
Comment 8 Aakash Jain 2021-07-13 05:49:17 PDT
(In reply to EWS from comment #6)
> Committed r279705 (239497@main): <https://commits.webkit.org/239497@main>
Newly added test http/tests/websocket/tests/hybi/multiple-set-cookies.htm is consistently failing on windows.

History: https://results.webkit.org/?suite=layout-tests&test=http%2Ftests%2Fwebsocket%2Ftests%2Fhybi%2Fmultiple-set-cookies.html
Comment 9 WebKit Commit Bot 2021-07-13 05:49:59 PDT
Re-opened since this is blocked by bug 227903
Comment 10 Alex Christensen 2021-07-13 16:22:13 PDT
Upon closer inspection, in pre-iOS 15 we get the cookies separated with a comma, but in iOS 15 we get the cookies separated with a semicolon, which matches Chrome and Firefox.
Comment 11 Alex Christensen 2021-07-13 16:38:18 PDT
Created attachment 433456 [details]
Patch
Comment 12 Alex Christensen 2021-07-14 09:59:16 PDT
Created attachment 433507 [details]
Patch