Lines Matching +full:- +full:- +full:host
74 this.host = null;
89 const protocolPattern = /^[a-z0-9.+-]+:/i;
90 const portPattern = /:[0-9]*$/;
128 if (!urlParseWarned && getOptionValue('--pending-deprecation')) {
149 StringPrototypeCharCodeAt(hostname, hostname.length - 1) ===
156 // "forbidden host code point" in the WHATWG URL Standard [1] and the
157 // characters in the host parsing loop in Url.prototype.parse, with the
160 // - ':' since this could cause a "protocol spoofing" bug
161 // - '@' since this could cause parts of the hostname to be confused with auth
162 // - '[' and ']' since this could cause a non-IPv6 hostname to be interpreted
165 // [1]: https://url.spec.whatwg.org/#forbidden-host-code-point
173 // Copy chrome, IE, opera backslash-handling behavior.
178 let start = -1;
179 let end = -1;
185 // Find first and last non-whitespace characters for trimming
189 if (start === -1) {
195 end = -1;
216 if (i - lastPos > 0)
227 // Check if string was non-empty (including strings with only whitespace)
228 if (start !== -1) {
232 if (end === -1) {
240 } else if (end === -1 && lastPos < url.length) {
243 } else if (end !== -1 && lastPos < end) {
280 // Figure out if it's got a host
282 // resolution will treat //foo/bar as host=foo,path=bar because that's
298 // the first instance of /, ?, ;, or # ends the host.
300 // If there is an @ in the hostname, then non-host chars *are* allowed
301 // to the left of the last @ sign, unless some host-ending character
302 // comes *before* the @-sign.
306 // http://a@b@c/ => user:a@b host:c
307 // http://a@b?@c => user:a host:b path:/?@c
309 let hostEnd = -1;
310 let atSign = -1;
311 let nonHost = -1;
319 i -= 1;
335 if (nonHost === -1)
341 // Find the first instance of any host-ending characters
342 if (nonHost === -1)
350 nonHost = -1;
353 if (hostEnd !== -1)
357 if (atSign !== -1) {
361 if (nonHost === -1) {
362 this.host = rest.slice(start);
365 this.host = rest.slice(start, nonHost);
403 // have non-ASCII characters, i.e. it doesn't matter if
404 // you call it with a domain that already is ASCII-only.
413 // Rather than trying to correct this by moving the non-host part into
424 this.host = h + p;
427 // the host field still retains them, though
429 this.hostname = this.hostname.slice(1, -1);
436 // Now rest is set to the post-host stuff.
445 let questionIdx = -1;
446 let hashIdx = -1;
453 } else if (code === CHAR_QUESTION_MARK && questionIdx === -1) {
458 if (questionIdx !== -1) {
459 if (hashIdx === -1) {
476 questionIdx !== -1 && (hashIdx === -1 || questionIdx < hashIdx);
478 if (firstIdx === -1) {
521 /* 0 - 9 */ '', '', '', '', '', '', '', '', '', '%09',
522 /* 10 - 19 */ '%0A', '', '', '%0D', '', '', '', '', '', '',
523 /* 20 - 29 */ '', '', '', '', '', '', '', '', '', '',
524 /* 30 - 39 */ '', '', '%20', '', '%22', '', '', '', '', '%27',
525 /* 40 - 49 */ '', '', '', '', '', '', '', '', '', '',
526 /* 50 - 59 */ '', '', '', '', '', '', '', '', '', '',
527 /* 60 - 69 */ '%3C', '', '%3E', '', '', '', '', '', '', '',
528 /* 70 - 79 */ '', '', '', '', '', '', '', '', '', '',
529 /* 80 - 89 */ '', '', '', '', '', '', '', '', '', '',
530 /* 90 - 99 */ '', '', '%5C', '', '%5E', '', '%60', '', '', '',
531 /* 100 - 109 */ '', '', '', '', '', '', '', '', '', '',
532 /* 110 - 119 */ '', '', '', '', '', '', '', '', '', '',
533 /* 120 - 125 */ '', '', '', '%7B', '%7C', '%7D',
566 // If it's an object, this is a no-op.
607 // ! - . _ ~
613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x00 - 0x0F
614 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x10 - 0x1F
615 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, // 0x20 - 0x2F
616 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, // 0x30 - 0x3F
617 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 0x4F
618 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 0x50 - 0x5F
619 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F
620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, // 0x70 - 0x7F
633 let host = '';
636 if (this.host) {
637 host = auth + this.host;
639 host = auth + (
645 host += ':' + this.port;
655 if (protocol && protocol.charCodeAt(protocol.length - 1) !== 58/* : */)
663 if (i - lastPos > 0)
669 if (i - lastPos > 0)
686 if (this.slashes || host) {
689 host = '//' + host;
695 host = '//';
706 return protocol + host + pathname + search + hash;
769 // first, if it's not file:, then we MUST have a host,
772 // if it is file:, then the host is dropped,
786 if (!relative.host &&
790 while (relPath.length && !(relative.host = relPath.shift()));
791 if (!relative.host) relative.host = '';
801 result.host = relative.host || '';
803 result.hostname = relative.hostname || relative.host;
818 relative.host || (relative.pathname && relative.pathname.charAt(0) === '/')
821 (result.host && relative.pathname));
828 // If the url is a non-slashed url, then relative
832 // Later on, put the first path part into the host field.
836 if (result.host) {
837 if (srcPath[0] === '') srcPath[0] = result.host;
838 else srcPath.unshift(result.host);
840 result.host = '';
845 if (relative.host) {
846 if (relPath[0] === '') relPath[0] = relative.host;
847 else relPath.unshift(relative.host);
849 relative.host = null;
856 if (relative.host || relative.host === '') {
857 if (result.host !== relative.host) result.auth = null;
858 result.host = relative.host;
868 // Fall through to the dot-handling below.
882 result.hostname = result.host = srcPath.shift();
883 // Occasionally the auth can get stuck only in host.
887 result.host && result.host.indexOf('@') > 0 && result.host.split('@');
890 result.host = result.hostname = authInHost.shift();
918 // however, if it ends in anything else non-slashy,
920 let last = srcPath.slice(-1)[0];
922 ((result.host || relative.host || srcPath.length > 1) &&
928 for (let i = srcPath.length - 1; i >= 0; i--) {
937 up--;
943 while (up--) {
953 if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
960 // put the host back
963 result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
964 // Occasionally the auth can get stuck only in host.
967 const authInHost = result.host && result.host.indexOf('@') > 0 ?
968 result.host.split('@') : false;
971 result.host = result.hostname = authInHost.shift();
975 mustEndAbs = mustEndAbs || (result.host && srcPath.length);
1000 let host = this.host;
1001 let port = portPattern.exec(host);
1007 host = host.slice(0, host.length - port.length);
1009 if (host) this.hostname = host;
1013 // this function, so non-strings can be rejected by underlying implementation.