Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get origin() {
// "Let uri-scheme be the scheme component of the URI,
// converted to lowercase."
var scheme = this._url.protocol().toLowerCase();
var hostname = this._url.hostname().toLowerCase();
var port = '';
if (this._url._parts.port !== null &&
this._url._parts.port !== URI.defaultPorts[this._url.protocol()]) {
port = ':' + this._url.port();
}
return scheme + '://' + hostname + port;
}
};