MCPcopy
hub / github.com/angular-ui/ui-grid / urlsAreSameOrigin

Function urlsAreSameOrigin

lib/test/angular/1.8.0/angular.js:21879–21885  ·  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

21877 * @returns {boolean} - True if both URLs have the same origin, and false otherwise.
21878 */
21879function urlsAreSameOrigin(url1, url2) {
21880 url1 = urlResolve(url1);
21881 url2 = urlResolve(url2);
21882
21883 return (url1.protocol === url2.protocol &&
21884 url1.host === url2.host);
21885}
21886
21887/**
21888 * 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