[webkit-changes] [WebKit/WebKit] d7472f: Check that the size of a cookie's path is not too ...

Rupin Mittal noreply at github.com
Fri Jul 28 19:59:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d7472f0d81e69ab8c62df926720430d69fdba732
      https://github.com/WebKit/WebKit/commit/d7472f0d81e69ab8c62df926720430d69fdba732
  Author: Rupin Mittal <rupin at apple.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any.js
    M LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any.serviceworker-expected.txt
    M Source/WebCore/Modules/cookie-store/CookieStore.cpp

  Log Message:
  -----------
  Check that the size of a cookie's path is not too large when setting a cookie with the Cookie Store API
https://bugs.webkit.org/show_bug.cgi?id=259571

Reviewed by Alex Christensen.

The spec (https://wicg.github.io/cookie-store/#set-cookie-algorithm)
dictates that in the set function, if the byte sequence length of the
path (in UTF8 format) is greater than the maximum attribute value size
(currently 1024 bytes according to
https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size),
then the promise should be rejected with a TypeError. This patch adds
this check the same way a previous patch added the same check for a
cookie's domain. It also adds testing for the length check for both path
and domain.

* LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any.js:
(promise_test.async testCase):
* LayoutTests/imported/w3c/web-platform-tests/cookie-store/cookieStore_set_arguments.https.any.serviceworker-expected.txt:
* Source/WebCore/Modules/cookie-store/CookieStore.cpp:
(WebCore::CookieStore::set):

Canonical link: https://commits.webkit.org/266410@main




More information about the webkit-changes mailing list