Changeset 209143 in webkit


Ignore:
Timestamp:
Nov 30, 2016, 11:48:04 AM (9 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
https://bugs.webkit.org/show_bug.cgi?id=165157
<rdar://problem/27896562>

Reviewed by Brian Burg.

Source/WebInspectorUI:

By correctly disallowing slashes in the scheme Web Inspector resolves
the correct absolute URL and doesn't end up trying to navigate to an
incorrect file URL.

  • UserInterface/Base/URLUtilities.js:

(parseURL):
Disallow "/" characters in the scheme portion. (/http://example.com)
Allow path to be optional before a fragment portion. (http://example.com#frag)

LayoutTests:

  • inspector/unit-tests/url-utilities-expected.txt:
  • inspector/unit-tests/url-utilities.html:

Add some tests for expected valid and invalid parseURL cases.
Note some cases that we don't handle properly and would benefit
by switching to URL constructor which is a much larger change.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r209140 r209143  
     12016-11-30  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
     4        https://bugs.webkit.org/show_bug.cgi?id=165157
     5        <rdar://problem/27896562>
     6
     7        Reviewed by Brian Burg.
     8
     9        * inspector/unit-tests/url-utilities-expected.txt:
     10        * inspector/unit-tests/url-utilities.html:
     11        Add some tests for expected valid and invalid parseURL cases.
     12        Note some cases that we don't handle properly and would benefit
     13        by switching to URL constructor which is a much larger change.
     14
    1152016-11-30  Dave Hyatt  <hyatt@apple.com>
    216
  • trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt

    r196654 r209143  
    11
    22== Running test suite: URLUtilities
     3-- Running test case: parseURL
     4
     5Test Invalid: a
     6PASS: Should not be a complete URL
     7PASS: URL constructor thinks this is invalid
     8
     9Test Invalid: /http://example.com
     10PASS: Should not be a complete URL
     11PASS: URL constructor thinks this is invalid
     12
     13Test Valid: http://example.com
     14PASS: scheme should be: 'http'
     15PASS: host should be: 'example.com'
     16PASS: port should be: 'null'
     17PASS: path should be: 'null'
     18PASS: queryString should be: 'null'
     19PASS: fragment should be: 'null'
     20PASS: lastPathComponent should be: 'null'
     21
     22Test Valid: http://example.com/
     23PASS: scheme should be: 'http'
     24PASS: host should be: 'example.com'
     25PASS: port should be: 'null'
     26PASS: path should be: '/'
     27PASS: queryString should be: 'null'
     28PASS: fragment should be: 'null'
     29PASS: lastPathComponent should be: 'null'
     30
     31Test Valid: http://example.com:80/
     32PASS: scheme should be: 'http'
     33PASS: host should be: 'example.com'
     34PASS: port should be: '80'
     35PASS: path should be: '/'
     36PASS: queryString should be: 'null'
     37PASS: fragment should be: 'null'
     38PASS: lastPathComponent should be: 'null'
     39
     40Test Valid: http://example.com/path/to/page.html
     41PASS: scheme should be: 'http'
     42PASS: host should be: 'example.com'
     43PASS: port should be: 'null'
     44PASS: path should be: '/path/to/page.html'
     45PASS: queryString should be: 'null'
     46PASS: fragment should be: 'null'
     47PASS: lastPathComponent should be: 'page.html'
     48
     49Test Valid: http://example.com/path/to/page.html?
     50PASS: scheme should be: 'http'
     51PASS: host should be: 'example.com'
     52PASS: port should be: 'null'
     53PASS: path should be: '/path/to/page.html'
     54PASS: queryString should be: ''
     55PASS: fragment should be: 'null'
     56PASS: lastPathComponent should be: 'page.html'
     57
     58Test Valid: http://example.com/path/to/page.html?a=1
     59PASS: scheme should be: 'http'
     60PASS: host should be: 'example.com'
     61PASS: port should be: 'null'
     62PASS: path should be: '/path/to/page.html'
     63PASS: queryString should be: 'a=1'
     64PASS: fragment should be: 'null'
     65PASS: lastPathComponent should be: 'page.html'
     66
     67Test Valid: http://example.com/path/to/page.html?a=1&b=2
     68PASS: scheme should be: 'http'
     69PASS: host should be: 'example.com'
     70PASS: port should be: 'null'
     71PASS: path should be: '/path/to/page.html'
     72PASS: queryString should be: 'a=1&b=2'
     73PASS: fragment should be: 'null'
     74PASS: lastPathComponent should be: 'page.html'
     75
     76Test Valid: http://example.com/path/to/page.html?a=1&b=2#test
     77PASS: scheme should be: 'http'
     78PASS: host should be: 'example.com'
     79PASS: port should be: 'null'
     80PASS: path should be: '/path/to/page.html'
     81PASS: queryString should be: 'a=1&b=2'
     82PASS: fragment should be: 'test'
     83PASS: lastPathComponent should be: 'page.html'
     84
     85Test Valid: http://example.com:123/path/to/page.html?a=1&b=2#test
     86PASS: scheme should be: 'http'
     87PASS: host should be: 'example.com'
     88PASS: port should be: '123'
     89PASS: path should be: '/path/to/page.html'
     90PASS: queryString should be: 'a=1&b=2'
     91PASS: fragment should be: 'test'
     92PASS: lastPathComponent should be: 'page.html'
     93
     94Test Valid: http://example.com/path/to/page.html#test
     95PASS: scheme should be: 'http'
     96PASS: host should be: 'example.com'
     97PASS: port should be: 'null'
     98PASS: path should be: '/path/to/page.html'
     99PASS: queryString should be: 'null'
     100PASS: fragment should be: 'test'
     101PASS: lastPathComponent should be: 'page.html'
     102
     103Test Valid: http://example.com#alpha/beta
     104PASS: scheme should be: 'http'
     105PASS: host should be: 'example.com'
     106PASS: port should be: 'null'
     107PASS: path should be: 'null'
     108PASS: queryString should be: 'null'
     109PASS: fragment should be: 'alpha/beta'
     110PASS: lastPathComponent should be: 'null'
     111
     112Test Valid: app-specific://example.com
     113PASS: scheme should be: 'app-specific'
     114PASS: host should be: 'example.com'
     115PASS: port should be: 'null'
     116PASS: path should be: 'null'
     117PASS: queryString should be: 'null'
     118PASS: fragment should be: 'null'
     119PASS: lastPathComponent should be: 'null'
     120
     121Test Valid: http://example
     122PASS: scheme should be: 'http'
     123PASS: host should be: 'example'
     124PASS: port should be: 'null'
     125PASS: path should be: 'null'
     126PASS: queryString should be: 'null'
     127PASS: fragment should be: 'null'
     128PASS: lastPathComponent should be: 'null'
     129
     130Test Valid: http://my.example.com
     131PASS: scheme should be: 'http'
     132PASS: host should be: 'my.example.com'
     133PASS: port should be: 'null'
     134PASS: path should be: 'null'
     135PASS: queryString should be: 'null'
     136PASS: fragment should be: 'null'
     137PASS: lastPathComponent should be: 'null'
     138
     139Test Valid: data:text/plain,test
     140PASS: scheme should be: 'data'
     141PASS: host should be: 'null'
     142PASS: port should be: 'null'
     143PASS: path should be: 'null'
     144PASS: queryString should be: 'null'
     145PASS: fragment should be: 'null'
     146PASS: lastPathComponent should be: 'null'
     147
     148-- Known issues <https://webkit.org/b/165155>
     149
     150Test Invalid: http://
     151FAIL: Should not be a complete URL
     152    Expected: truthy
     153    Actual: false
     154PASS: URL constructor thinks this is invalid
     155
     156Test Invalid: http://example.com:999999999
     157FAIL: Should not be a complete URL
     158    Expected: truthy
     159    Actual: false
     160PASS: URL constructor thinks this is invalid
     161
     162Test Valid: http:example.com/
     163FAIL: scheme should be: 'http'
     164    Expected: "http"
     165    Actual: null
     166FAIL: host should be: 'example.com'
     167    Expected: "example.com"
     168    Actual: null
     169PASS: port should be: 'null'
     170FAIL: path should be: '/'
     171    Expected: "/"
     172    Actual: null
     173PASS: queryString should be: 'null'
     174PASS: fragment should be: 'null'
     175PASS: lastPathComponent should be: 'null'
     176
     177Test Valid: http:/example.com/
     178FAIL: scheme should be: 'http'
     179    Expected: "http"
     180    Actual: null
     181FAIL: host should be: 'example.com'
     182    Expected: "example.com"
     183    Actual: null
     184PASS: port should be: 'null'
     185FAIL: path should be: '/'
     186    Expected: "/"
     187    Actual: null
     188PASS: queryString should be: 'null'
     189PASS: fragment should be: 'null'
     190PASS: lastPathComponent should be: 'null'
     191
     192Test Valid: http://user@pass:example.com/
     193FAIL: scheme should be: 'http'
     194    Expected: "http"
     195    Actual: null
     196FAIL: host should be: 'example.com'
     197    Expected: "example.com"
     198    Actual: null
     199PASS: port should be: 'null'
     200FAIL: path should be: '/'
     201    Expected: "/"
     202    Actual: null
     203PASS: queryString should be: 'null'
     204PASS: fragment should be: 'null'
     205PASS: lastPathComponent should be: 'null'
     206
     207Test Valid: http://example.com?key=alpha/beta
     208PASS: scheme should be: 'http'
     209FAIL: host should be: 'example.com'
     210    Expected: "example.com"
     211    Actual: "example.com?key=alpha"
     212PASS: port should be: 'null'
     213FAIL: path should be: 'null'
     214    Expected: null
     215    Actual: "/beta"
     216FAIL: queryString should be: 'key=alpha/beta'
     217    Expected: "key=alpha/beta"
     218    Actual: null
     219PASS: fragment should be: 'null'
     220FAIL: lastPathComponent should be: 'null'
     221    Expected: null
     222    Actual: "beta"
     223
    3224-- Running test case: parseDataURL
    4 Test: https://webkit.org
     225
     226Test Invalid: https://webkit.org
    5227PASS: Should not be a data URL
    6 Test: data:
     228
     229Test Invalid: data:
    7230PASS: Should not be a data URL
    8 Test: data:text/plain;test
     231
     232Test Invalid: data:text/plain;test
    9233PASS: Should not be a data URL
    10 Test: data:text/plain;base64;test
     234
     235Test Invalid: data:text/plain;base64;test
    11236PASS: Should not be a data URL
    12237
    13 Test: data:,
     238Test Valid: data:,
     239PASS: scheme should always be 'data'
    14240PASS: mimeType should be: 'text/plain'
    15241PASS: charset should be: 'US-ASCII'
     
    18244PASS: Resolved content should be: ''
    19245
    20 Test: data:,test
     246Test Valid: data:,test
     247PASS: scheme should always be 'data'
    21248PASS: mimeType should be: 'text/plain'
    22249PASS: charset should be: 'US-ASCII'
     
    25252PASS: Resolved content should be: 'test'
    26253
    27 Test: data:text/plain,test
     254Test Valid: data:text/plain,test
     255PASS: scheme should always be 'data'
    28256PASS: mimeType should be: 'text/plain'
    29257PASS: charset should be: 'US-ASCII'
     
    32260PASS: Resolved content should be: 'test'
    33261
    34 Test: data:text/plain;charset=TEST,test
     262Test Valid: data:text/plain;charset=TEST,test
     263PASS: scheme should always be 'data'
    35264PASS: mimeType should be: 'text/plain'
    36265PASS: charset should be: 'TEST'
     
    39268PASS: Resolved content should be: 'test'
    40269
    41 Test: data:application/json,{"name":"test","list":[1,2,3]}
     270Test Valid: data:application/json,{"name":"test","list":[1,2,3]}
     271PASS: scheme should always be 'data'
    42272PASS: mimeType should be: 'application/json'
    43273PASS: charset should be: 'US-ASCII'
     
    46276PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
    47277
    48 Test: data:application/json,%7B%22name%22%3A%22test%22%2C%22list%22%3A%5B1%2C2%2C3%5D%7D
     278Test Valid: data:application/json,%7B%22name%22%3A%22test%22%2C%22list%22%3A%5B1%2C2%2C3%5D%7D
     279PASS: scheme should always be 'data'
    49280PASS: mimeType should be: 'application/json'
    50281PASS: charset should be: 'US-ASCII'
     
    53284PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
    54285
    55 Test: data:application/json;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119
     286Test Valid: data:application/json;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119
     287PASS: scheme should always be 'data'
    56288PASS: mimeType should be: 'application/json'
    57289PASS: charset should be: 'US-ASCII'
     
    60292PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
    61293
    62 Test: data:application/json;charset=utf-8;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119
     294Test Valid: data:application/json;charset=utf-8;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119
     295PASS: scheme should always be 'data'
    63296PASS: mimeType should be: 'application/json'
    64297PASS: charset should be: 'utf-8'
     
    67300PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
    68301
    69 Test: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
     302Test Valid: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
     303PASS: scheme should always be 'data'
    70304PASS: mimeType should be: 'image/png'
    71305PASS: charset should be: 'US-ASCII'
  • trunk/LayoutTests/inspector/unit-tests/url-utilities.html

    r196654 r209143  
    99
    1010    suite.addTestCase({
     11        name: "parseURL",
     12        test() {
     13            function testInvalid(url) {
     14                InspectorTest.log("");
     15                InspectorTest.log("Test Invalid: " + url);
     16                InspectorTest.expectThat(parseURL(url).scheme === null, "Should not be a complete URL");
     17
     18                try {
     19                    new URL(url);
     20                    InspectorTest.fail("URL constructor thinks this is valid");
     21                } catch (e) {
     22                    InspectorTest.pass("URL constructor thinks this is invalid");
     23                }
     24            }
     25
     26            function testValid(url, expected) {
     27                InspectorTest.log("");
     28                InspectorTest.log("Test Valid: " + url);
     29
     30                let {scheme: expectedScheme, host: expectedHost, port: expectedPort, path: expectedPath, queryString: expectedQueryString, fragment: expectedFragment, lastPathComponent: expectedLastPathComponent} = expected;
     31                let {scheme: actualScheme, host: actualHost, port: actualPort, path: actualPath, queryString: actualQueryString, fragment: actualFragment, lastPathComponent: actualLastPathComponent} = parseURL(url);
     32
     33                InspectorTest.expectEqual(actualScheme, expectedScheme, `scheme should be: '${expectedScheme}'`);
     34                InspectorTest.expectEqual(actualHost, expectedHost, `host should be: '${expectedHost}'`);
     35                InspectorTest.expectEqual(actualPort, expectedPort, `port should be: '${expectedPort}'`);
     36                InspectorTest.expectEqual(actualPath, expectedPath, `path should be: '${expectedPath}'`);
     37                InspectorTest.expectEqual(actualQueryString, expectedQueryString, `queryString should be: '${expectedQueryString}'`);
     38                InspectorTest.expectEqual(actualFragment, expectedFragment, `fragment should be: '${expectedFragment}'`);
     39                InspectorTest.expectEqual(actualLastPathComponent, expectedLastPathComponent, `lastPathComponent should be: '${expectedLastPathComponent}'`);
     40            }
     41
     42            testInvalid("a");
     43            testInvalid("/http://example.com");
     44
     45            testValid("http://example.com", {
     46                scheme: "http",
     47                host: "example.com",
     48                port: null,
     49                path: null,
     50                queryString: null,
     51                fragment: null,
     52                lastPathComponent: null,
     53            });
     54
     55            testValid("http://example.com/", {
     56                scheme: "http",
     57                host: "example.com",
     58                port: null,
     59                path: "/",
     60                queryString: null,
     61                fragment: null,
     62                lastPathComponent: null,
     63            });
     64
     65            testValid("http://example.com:80/", {
     66                scheme: "http",
     67                host: "example.com",
     68                port: 80,
     69                path: "/",
     70                queryString: null,
     71                fragment: null,
     72                lastPathComponent: null,
     73            });
     74
     75            testValid("http://example.com/path/to/page.html", {
     76                scheme: "http",
     77                host: "example.com",
     78                port: null,
     79                path: "/path/to/page.html",
     80                queryString: null,
     81                fragment: null,
     82                lastPathComponent: "page.html",
     83            });
     84
     85            testValid("http://example.com/path/to/page.html?", {
     86                scheme: "http",
     87                host: "example.com",
     88                port: null,
     89                path: "/path/to/page.html",
     90                queryString: "",
     91                fragment: null,
     92                lastPathComponent: "page.html",
     93            });
     94
     95            testValid("http://example.com/path/to/page.html?a=1", {
     96                scheme: "http",
     97                host: "example.com",
     98                port: null,
     99                path: "/path/to/page.html",
     100                queryString: "a=1",
     101                fragment: null,
     102                lastPathComponent: "page.html",
     103            });
     104
     105            testValid("http://example.com/path/to/page.html?a=1&b=2", {
     106                scheme: "http",
     107                host: "example.com",
     108                port: null,
     109                path: "/path/to/page.html",
     110                queryString: "a=1&b=2",
     111                fragment: null,
     112                lastPathComponent: "page.html",
     113            });
     114
     115            testValid("http://example.com/path/to/page.html?a=1&b=2#test", {
     116                scheme: "http",
     117                host: "example.com",
     118                port: null,
     119                path: "/path/to/page.html",
     120                queryString: "a=1&b=2",
     121                fragment: "test",
     122                lastPathComponent: "page.html",
     123            });
     124
     125            testValid("http://example.com:123/path/to/page.html?a=1&b=2#test", {
     126                scheme: "http",
     127                host: "example.com",
     128                port: 123,
     129                path: "/path/to/page.html",
     130                queryString: "a=1&b=2",
     131                fragment: "test",
     132                lastPathComponent: "page.html",
     133            });
     134
     135            testValid("http://example.com/path/to/page.html#test", {
     136                scheme: "http",
     137                host: "example.com",
     138                port: null,
     139                path: "/path/to/page.html",
     140                queryString: null,
     141                fragment: "test",
     142                lastPathComponent: "page.html",
     143            });
     144
     145            testValid("http://example.com#alpha/beta", {
     146                scheme: "http",
     147                host: "example.com",
     148                port: null,
     149                path: null,
     150                queryString: null,
     151                fragment: "alpha/beta",
     152                lastPathComponent: null,
     153            });
     154
     155            testValid("app-specific://example.com", {
     156                scheme: "app-specific",
     157                host: "example.com",
     158                port: null,
     159                path: null,
     160                queryString: null,
     161                fragment: null,
     162                lastPathComponent: null,
     163            });
     164
     165            testValid("http://example", {
     166                scheme: "http",
     167                host: "example",
     168                port: null,
     169                path: null,
     170                queryString: null,
     171                fragment: null,
     172                lastPathComponent: null,
     173            });
     174
     175            testValid("http://my.example.com", {
     176                scheme: "http",
     177                host: "my.example.com",
     178                port: null,
     179                path: null,
     180                queryString: null,
     181                fragment: null,
     182                lastPathComponent: null,
     183            });
     184
     185            // Data URLs just spit back the scheme.
     186            testValid("data:text/plain,test", {
     187                scheme: "data",
     188                host: null,
     189                port: null,
     190                path: null,
     191                queryString: null,
     192                fragment: null,
     193                lastPathComponent: null,
     194            });
     195
     196            // FIXME: <https://webkit.org/b/165155> Web Inspector: Use URL constructor to better handle all kinds of URLs
     197            InspectorTest.log("");
     198            InspectorTest.log("-- Known issues <https://webkit.org/b/165155>");
     199
     200            testInvalid("http://");
     201            testInvalid("http://example.com:999999999");
     202
     203            testValid("http:example.com/", {
     204                scheme: "http",
     205                host: "example.com",
     206                port: null,
     207                path: "/",
     208                queryString: null,
     209                fragment: null,
     210                lastPathComponent: null,
     211            });
     212
     213            testValid("http:/example.com/", {
     214                scheme: "http",
     215                host: "example.com",
     216                port: null,
     217                path: "/",
     218                queryString: null,
     219                fragment: null,
     220                lastPathComponent: null,
     221            });
     222
     223            testValid("http://user@pass:example.com/", {
     224                scheme: "http",
     225                host: "example.com",
     226                port: null,
     227                path: "/",
     228                queryString: null,
     229                fragment: null,
     230                lastPathComponent: null,
     231            });
     232
     233            testValid("http://example.com?key=alpha/beta", {
     234                scheme: "http",
     235                host: "example.com",
     236                port: null,
     237                path: null,
     238                queryString: "key=alpha/beta",
     239                fragment: null,
     240                lastPathComponent: null,
     241            });
     242
     243            return true;
     244        }
     245    });
     246
     247
     248    suite.addTestCase({
    11249        name: "parseDataURL",
    12         test: () => {
     250        test() {
    13251            function testInvalid(url) {
    14                 InspectorTest.log("Test: " + url);
     252                InspectorTest.log("");
     253                InspectorTest.log("Test Invalid: " + url);
    15254                InspectorTest.expectThat(parseDataURL(url) === null, "Should not be a data URL");
    16255            }
     
    18257            function testValid(url, expected) {
    19258                InspectorTest.log("");
    20                 InspectorTest.log("Test: " + url);
     259                InspectorTest.log("Test Valid: " + url);
    21260
    22261                let {mimeType: expectedMimeType, charset: expectedCharset, base64: expectedBase64, data: expectedData, content: expectedContent} = expected;
     
    26265                    actualContent = atob(actualContent);
    27266
    28                 InspectorTest.assert(actualScheme === "data", "scheme should always be 'data'");
    29                 InspectorTest.expectThat(actualMimeType === expectedMimeType, `mimeType should be: '${expectedMimeType}'`);
    30                 InspectorTest.expectThat(actualCharset === expectedCharset, `charset should be: '${expectedCharset}'`);
    31                 InspectorTest.expectThat(actualBase64 === expectedBase64, `base64 should be: '${expectedBase64}'`);
    32                 InspectorTest.expectThat(actualData === expectedData, `data should be: '${expectedData}'`);
     267                InspectorTest.expectEqual(actualScheme, "data", "scheme should always be 'data'");
     268                InspectorTest.expectEqual(actualMimeType, expectedMimeType, `mimeType should be: '${expectedMimeType}'`);
     269                InspectorTest.expectEqual(actualCharset, expectedCharset, `charset should be: '${expectedCharset}'`);
     270                InspectorTest.expectEqual(actualBase64, expectedBase64, `base64 should be: '${expectedBase64}'`);
     271                InspectorTest.expectEqual(actualData, expectedData, `data should be: '${expectedData}'`);
    33272                if (expectedContent !== null)
    34273                    InspectorTest.expectThat(actualContent === expectedContent, `Resolved content should be: '${expectedContent}'`);
  • trunk/Source/WebInspectorUI/ChangeLog

    r209115 r209143  
     12016-11-30  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
     4        https://bugs.webkit.org/show_bug.cgi?id=165157
     5        <rdar://problem/27896562>
     6
     7        Reviewed by Brian Burg.
     8
     9        By correctly disallowing slashes in the scheme Web Inspector resolves
     10        the correct absolute URL and doesn't end up trying to navigate to an
     11        incorrect file URL.
     12
     13        * UserInterface/Base/URLUtilities.js:
     14        (parseURL):
     15        Disallow "/" characters in the scheme portion. (/http://example.com)
     16        Allow path to be optional before a fragment portion. (http://example.com#frag)
     17
    1182016-11-29  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js

    r196654 r209143  
    2424 */
    2525
     26// FIXME: <https://webkit.org/b/165155> Web Inspector: Use URL constructor to better handle all kinds of URLs
     27
    2628function removeURLFragment(url)
    2729{
     
    9799        return {scheme: "data", host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null};
    98100
    99     var match = url.match(/^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i);
     101    var match = url.match(/^([^\/:]+):\/\/([^\/#:]*)(?::([\d]+))?(?:(\/[^#]*)?(?:#(.*))?)?$/i);
    100102    if (!match)
    101103        return {scheme: null, host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null};
Note: See TracChangeset for help on using the changeset viewer.