Changeset 206159 in webkit


Ignore:
Timestamp:
Sep 20, 2016 11:34:19 AM (8 years ago)
Author:
achristensen@apple.com
Message:

URLParser should allow '@' in user
https://bugs.webkit.org/show_bug.cgi?id=162272

Reviewed by Tim Horton.

Source/WebCore:

Covered by a new API test.

  • platform/URLParser.cpp:

(WebCore::URLParser::parse):
The spec describes using an "@ flag" and rewinding iterators. I've implemented the authority parsing
and host parsing a little differently, but this makes it equivalent.

Tools:

  • TestWebKitAPI/Tests/WebCore/URLParser.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206158 r206159  
     12016-09-20  Alex Christensen  <achristensen@webkit.org>
     2
     3        URLParser should allow '@' in user
     4        https://bugs.webkit.org/show_bug.cgi?id=162272
     5
     6        Reviewed by Tim Horton.
     7
     8        Covered by a new API test.
     9
     10        * platform/URLParser.cpp:
     11        (WebCore::URLParser::parse):
     12        The spec describes using an "@ flag" and rewinding iterators.  I've implemented the authority parsing
     13        and host parsing a little differently, but this makes it equivalent.
     14
    1152016-09-20  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebCore/platform/URLParser.cpp

    r206158 r206159  
    11441144            {
    11451145                if (*c == '@') {
    1146                     parseAuthority<serialized>(CodePointIterator<CharacterType>(authorityOrHostBegin, c));
     1146                    auto lastAt = c;
     1147                    auto findLastAt = c;
     1148                    while (!findLastAt.atEnd()) {
     1149                        if (*findLastAt == '@')
     1150                            lastAt = findLastAt;
     1151                        ++findLastAt;
     1152                    }
     1153                    parseAuthority<serialized>(CodePointIterator<CharacterType>(authorityOrHostBegin, lastAt));
     1154                    c = lastAt;
    11471155                    incrementIteratorSkippingTabAndNewLine<serialized>(c);
    11481156                    authorityOrHostBegin = c;
  • trunk/Tools/ChangeLog

    r206158 r206159  
     12016-09-20  Alex Christensen  <achristensen@webkit.org>
     2
     3        URLParser should allow '@' in user
     4        https://bugs.webkit.org/show_bug.cgi?id=162272
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112016-09-20  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r206158 r206159  
    545545        {"file", "", "", "", 0, "/C:/foo/bar", "", "", "file:///C:/foo/bar"},
    546546        {"file", "", "", "", 0, "/C|/foo/bar", "", "", "file:///C|/foo/bar"});
     547    checkRelativeURLDifferences("https://@test@test@example:800/", "http://doesnotmatter/",
     548        {"https", "@test@test", "", "example", 800, "/", "", "", "https://%40test%40test@example:800/"},
     549        {"", "", "", "", 0, "", "", "", "https://@test@test@example:800/"});
    547550}
    548551
Note: See TracChangeset for help on using the changeset viewer.