Changeset 228371 in webkit


Ignore:
Timestamp:
Feb 11, 2018 11:33:46 PM (6 years ago)
Author:
Carlos Garcia Campos
Message:

WebDriver: addCookie command should prepend a dot to domain if missing
https://bugs.webkit.org/show_bug.cgi?id=182328
<rdar://problem/37116398>

Reviewed by Michael Catanzaro.

RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::addSingleCookie):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228369 r228371  
     12018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: addCookie command should prepend a dot to domain if missing
     4        https://bugs.webkit.org/show_bug.cgi?id=182328
     5        <rdar://problem/37116398>
     6
     7        Reviewed by Michael Catanzaro.
     8
     9        RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
     10
     11        Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
     12
     13        * UIProcess/Automation/WebAutomationSession.cpp:
     14        (WebKit::WebAutomationSession::addSingleCookie):
     15
    1162018-02-11  Yousuke Kimoto  <yousuke.kimoto@sony.com>
    217
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r228283 r228371  
    12081208    if (domain.isEmpty())
    12091209        domain = activeURL.host();
    1210 
     1210    else if (domain[0] != '.') {
     1211        // RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
     1212        // Assume that any host that ends with a digit is trying to be an IP address.
     1213        if (!WebCore::URL::hostIsIPAddress(domain))
     1214            domain = makeString('.', domain);
     1215    }
    12111216    cookie.domain = domain;
    12121217
Note: See TracChangeset for help on using the changeset viewer.