Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RPCManager.isLocalUrl is broken

    RPCManager.isLocalUrl compares hostname and port of a given URL to window.location.hostname and window.location.port in the browser.

    However, when given a URL _without_ a port (http://somehost/somepath), the comparison is incorrectly returns false. RPCManager._getHostAndPort(url) returns "port=undefined" for URLs without an explicit port specified, whereas location.port returns an empty string.

    Moreover, the function should also take into account the the default ports for http (80) and https (443). I.e. comparing "http://somehost/somepath" to "http://somehost:80/somepath" should also return true. The same applies to https URLs like "https://somehost/somepath" to "https://somehost:443/somepath"

    Tested with IE7, and Version 7.0beta9 (2009-04-18)

    #2
    That would be nice, unfortunately, not all browsers actually figure out that these URLs are equivalent. We're matching lowest common denominator URL detection.

    Comment

    Working...
    X