Changeset 206036 in webkit


Ignore:
Timestamp:
Sep 16, 2016 11:59:01 AM (8 years ago)
Author:
achristensen@apple.com
Message:

URLParser should percent encode the user and password according to spec
https://bugs.webkit.org/show_bug.cgi?id=162049

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests based on the web platform tests.

  • platform/URLParser.cpp:

(WebCore::URLParser::parseAuthority):

Tools:

  • TestWebKitAPI/Tests/WebCore/URLParser.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206035 r206036  
     12016-09-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        URLParser should percent encode the user and password according to spec
     4        https://bugs.webkit.org/show_bug.cgi?id=162049
     5
     6        Reviewed by Tim Horton.
     7
     8        Covered by new API tests based on the web platform tests.
     9
     10        * platform/URLParser.cpp:
     11        (WebCore::URLParser::parseAuthority):
     12
    1132016-09-16  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebCore/platform/URLParser.cpp

    r206035 r206036  
    15231523            break;
    15241524        }
    1525         m_buffer.append(*iterator);
     1525        utf8PercentEncode(*iterator, m_buffer, isInUserInfoEncodeSet);
    15261526    }
    15271527    for (; !iterator.atEnd(); ++iterator)
    1528         m_buffer.append(*iterator);
     1528        utf8PercentEncode(*iterator, m_buffer, isInUserInfoEncodeSet);
    15291529    m_url.m_passwordEnd = m_buffer.length();
    15301530    if (!m_url.m_userEnd)
  • trunk/Tools/ChangeLog

    r206035 r206036  
     12016-09-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        URLParser should percent encode the user and password according to spec
     4        https://bugs.webkit.org/show_bug.cgi?id=162049
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112016-09-16  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r206035 r206036  
    499499        {"http", "", "", "host", 0, "/path...", "", "", "http://host/path..."},
    500500        {"http", "", "", "host", 0, "/path%2e.%2E", "", "", "http://host/path%2e.%2E"});
     501
     502    checkRelativeURLDifferences(wideString(L"http://foo:💩@example.com/bar"), "http://other.com/",
     503        {"http", "foo", wideString(L"💩"), "example.com", 0, "/bar", "", "", "http://foo:%F0%9F%92%A9@example.com/bar"},
     504        {"", "", "", "", 0, "", "", "", wideString(L"http://foo:💩@example.com/bar")});
     505    checkRelativeURLDifferences("http://&a:foo(b]c@d:2/", "http://example.org/foo/bar",
     506        {"http", "&a", "foo(b]c", "d", 2, "/", "", "", "http://&a:foo(b%5Dc@d:2/"},
     507        {"", "", "", "", 0, "", "", "", "http://&a:foo(b]c@d:2/"});
     508    checkRelativeURLDifferences("http://`{}:`{}@h/`{}?`{}", "http://doesnotmatter/",
     509        {"http", "`{}", "`{}", "h", 0, "/%60%7B%7D", "`{}", "", "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}"},
     510        {"", "", "", "", 0, "", "", "", "http://`{}:`{}@h/`{}?`{}"});
    501511}
    502512
Note: See TracChangeset for help on using the changeset viewer.