MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / urlsAreSameOrigin

Function urlsAreSameOrigin

lib/test/angular/1.7.0/angular.js:21093–21099  ·  view source on GitHub ↗

* Determine if two URLs share the same origin. * * @param {string|Object} url1 - First URL to compare as a string or a normalized URL in the form of * a dictionary object returned by `urlResolve()`. * @param {string|object} url2 - Second URL to compare as a string or a normalized URL in the

(url1, url2)

Source from the content-addressed store, hash-verified

21091 * @returns {boolean} - True if both URLs have the same origin, and false otherwise.
21092 */
21093function urlsAreSameOrigin(url1, url2) {
21094 url1 = urlResolve(url1);
21095 url2 = urlResolve(url2);
21096
21097 return (url1.protocol === url2.protocol &&
21098 url1.host === url2.host);
21099}
21100
21101/**
21102 * Returns the current document base URL.

Callers 2

urlIsSameOriginFunction · 0.70
urlIsSameOriginAsBaseUrlFunction · 0.70

Calls 1

urlResolveFunction · 0.70

Tested by

no test coverage detected