Skip to content

Commit

Permalink
Handles ports for SW. (#535)
Browse files Browse the repository at this point in the history
* Handles ports for SW.

Fixes #532
  • Loading branch information
paullewis authored and paulirish committed Jul 27, 2016
1 parent 3e632f9 commit 8c39f91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lighthouse-core/driver/gatherers/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class ServiceWorker extends Gather {
*/
static getOrigin(url) {
const parsedURL = require('url').parse(url);
return `${parsedURL.protocol}//${parsedURL.hostname}`;
return `${parsedURL.protocol}//${parsedURL.hostname}` +
(parsedURL.port ? `:${parsedURL.port}` : '');
}

/**
Expand Down

0 comments on commit 8c39f91

Please sign in to comment.