Skip to content

Commit

Permalink
Use hostname instead of host
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Apr 30, 2018
1 parent 9d95eeb commit f9b3442
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/audits/uses-rel-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'use strict';

const Audit = require('./audit');
const Util = require('../report/v2/renderer/util');
const Util = require('../report/html/renderer/util');
const URL = require('../lib/url-shim');
const UnusedBytes = require('./byte-efficiency/byte-efficiency-audit');
const THRESHOLD_IN_MS = 100;
Expand Down
6 changes: 3 additions & 3 deletions lighthouse-core/lib/url-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ class URLShim extends URL {
const urlAInfo = new URL(urlA);
const urlBInfo = new URL(urlB);

if (!urlAInfo.host || !urlBInfo.host) {
if (!urlAInfo.hostname || !urlBInfo.hostname) {
return false;
}

const urlARootDomain = urlAInfo.host.split('.').slice(-2).join('.');
const urlBRootDomain = urlBInfo.host.split('.').slice(-2).join('.');
const urlARootDomain = urlAInfo.hostname.split('.').slice(-2).join('.');
const urlBRootDomain = urlBInfo.hostname.split('.').slice(-2).join('.');

return urlARootDomain === urlBRootDomain;
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/test/audits/uses-rel-preload-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const UsesRelPreload = require('../../audits/uses-rel-preload.js');
const assert = require('assert');
const defaultMainResource = {
url: 'http://www.example.com',
url: 'http://www.example.com:3000',
_endTime: 1,
};

Expand Down

0 comments on commit f9b3442

Please sign in to comment.