From 99be9f5c3098cc833d4eb56c78f16aef22388026 Mon Sep 17 00:00:00 2001 From: gorhill Date: Fri, 6 Feb 2015 18:11:36 -0500 Subject: [PATCH] be ready to deal with invalid hostname --- src/js/pagestore.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/pagestore.js b/src/js/pagestore.js index 2aefdcf38..926a975a3 100644 --- a/src/js/pagestore.js +++ b/src/js/pagestore.js @@ -708,6 +708,12 @@ PageStore.prototype.filterRequestNoCache = function(context) { PageStore.prototype.logRequest = function(context, result) { var requestHostname = context.requestHostname; + // rhill 20150206: + // be prepared to handle invalid requestHostname, I've seen this + // happen: http://./ + if ( requestHostname === '' ) { + requestHostname = context.pageHostname; + } if ( this.hostnameToCountMap.hasOwnProperty(requestHostname) === false ) { this.hostnameToCountMap[requestHostname] = 0; this.contentLastModified = Date.now();