From 1f08aa047d30710af0e4418485227da088b058f8 Mon Sep 17 00:00:00 2001 From: Paul Lewis Date: Wed, 27 Jul 2016 17:31:55 +0100 Subject: [PATCH] Handles ports for SW. SW check needs ports. Fixes #532 --- lighthouse-core/driver/gatherers/service-worker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/driver/gatherers/service-worker.js b/lighthouse-core/driver/gatherers/service-worker.js index fecdd718e0b5..7b046d2e41b2 100644 --- a/lighthouse-core/driver/gatherers/service-worker.js +++ b/lighthouse-core/driver/gatherers/service-worker.js @@ -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}` : ''; } /**