[Webkit-unassigned] [Bug 60389] New: Web Inspector: missing colon in URL calculation in ExtensionAPI.js

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 6 11:18:09 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=60389

           Summary: Web Inspector: missing colon in URL calculation in
                    ExtensionAPI.js
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Web Inspector
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: pmuellr at yahoo.com
                CC: timothy at apple.com, rik at webkit.org, keishi at webkit.org,
                    pmuellr at yahoo.com, joepeck at webkit.org,
                    pfeldman at chromium.org, yurys at chromium.org,
                    bweinstein at apple.com, apavlov at chromium.org,
                    loislo at chromium.org


In ExtensionAPI.js, on line 447, in function expandURL(), the expression to set the variable baseURL does not add a colon between the hostname and port.

The existing code looks like this:

    function expandURL(url)
    {
        if (!url)
            return url;
        if (/^[^/]+:/.exec(url)) // See if url has schema.
            return url;
        var baseURL = location.protocol + "//" + location.hostname + location.port;
        if (/^\//.exec(url))
            return baseURL + url;
        return baseURL + location.pathname.replace(/\/[^/]*$/,"/") + url;
    }

I've modified the code for weinre to do this:

        var baseURL = location.protocol + "//" + location.hostname + ":" + location.port;

Note this means that for http/80, URLs are generate that look like this:

    http://host.name.here:/path/goes/here

Basically, empty string after the colon.  The browser seemed to do a good job handling this, but not sure how kosher that really is.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list