From c1a64eee027f363d58ee4a628ef569f2be552435 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 26 Oct 2020 16:58:40 -0700 Subject: [PATCH] browser(webkit): serialize set-cookie \n-separated (#4243) --- browser_patches/webkit/BUILD_NUMBER | 4 ++-- browser_patches/webkit/patches/bootstrap.diff | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/browser_patches/webkit/BUILD_NUMBER b/browser_patches/webkit/BUILD_NUMBER index 81573b501dd9e..51af6cc7945a4 100644 --- a/browser_patches/webkit/BUILD_NUMBER +++ b/browser_patches/webkit/BUILD_NUMBER @@ -1,2 +1,2 @@ -1365 -Changed: yurys@chromium.org Mon 26 Oct 2020 12:55:56 PM PDT +1366 +Changed: pavel.feldman@gmail.com Mon Oct 26 16:07:00 PDT 2020 diff --git a/browser_patches/webkit/patches/bootstrap.diff b/browser_patches/webkit/patches/bootstrap.diff index cea226ad7d2e2..8b84c2f170176 100644 --- a/browser_patches/webkit/patches/bootstrap.diff +++ b/browser_patches/webkit/patches/bootstrap.diff @@ -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