Skip to content

Commit

Permalink
browser(webkit): serialize set-cookie \n-separated (#4243)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Oct 26, 2020
1 parent 86e1e3f commit c1a64ee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions browser_patches/webkit/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1365
Changed: [email protected] Mon 26 Oct 2020 12:55:56 PM PDT
1366
Changed: [email protected] Mon Oct 26 16:07:00 PDT 2020
17 changes: 17 additions & 0 deletions browser_patches/webkit/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6395,6 +6395,23 @@ index a34dc220bbb9a92b40dfb463e8724e81ac745b2c..8ecedd5dae88469366a619b96960598c
String PlatformKeyboardEvent::singleCharacterString(unsigned val)
{
switch (val) {
diff --git a/Source/WebCore/platform/network/HTTPHeaderMap.cpp b/Source/WebCore/platform/network/HTTPHeaderMap.cpp
index 39cb560e54bf9efd2dad6e1fb60dd0f609daf6bf..91c132460d4b466f61a8c579f70329fdde3b130f 100644
--- a/Source/WebCore/platform/network/HTTPHeaderMap.cpp
+++ b/Source/WebCore/platform/network/HTTPHeaderMap.cpp
@@ -205,8 +205,11 @@ void HTTPHeaderMap::add(HTTPHeaderName name, const String& value)
auto index = m_commonHeaders.findMatching([&](auto& header) {
return header.key == name;
});
+ // Align with Chromium and Firefox, but just for SetCookies where it is critical:
+ // https://bit.ly/2HCa0iq
+ String separator = name == HTTPHeaderName::SetCookie ? "\n " : ", ";
if (index != notFound)
- m_commonHeaders[index].value = makeString(m_commonHeaders[index].value, ", ", value);
+ m_commonHeaders[index].value = makeString(m_commonHeaders[index].value, separator, value);
else
m_commonHeaders.append(CommonHeader { name, value });
}
diff --git a/Source/WebCore/platform/network/NetworkStateNotifier.h b/Source/WebCore/platform/network/NetworkStateNotifier.h
index 87930048f4fd18d6098af7de4da25be532df5931..2bb2afcf9473b0d5d97efbe18dd7b8145bc5f932 100644
--- a/Source/WebCore/platform/network/NetworkStateNotifier.h
Expand Down

0 comments on commit c1a64ee

Please sign in to comment.