diff --git a/src/streaming/controllers/CommonAccessTokenController.js b/src/streaming/controllers/CommonAccessTokenController.js index 8847bc2f5d..334f4f0c73 100644 --- a/src/streaming/controllers/CommonAccessTokenController.js +++ b/src/streaming/controllers/CommonAccessTokenController.js @@ -44,8 +44,12 @@ function CommonAccessTokenController() { } const commonAccessTokenHeader = httpResponse.headers[Constants.COMMON_ACCESS_TOKEN_HEADER] - const host = Utils.getHostFromUrl(httpResponse.request.url) - hostTokenMap[host] = commonAccessTokenHeader + if (commonAccessTokenHeader) { + const host = Utils.getHostFromUrl(httpResponse.request.url) + if (host) { + hostTokenMap[host] = commonAccessTokenHeader + } + } } function getCommonAccessTokenForUrl(url) { diff --git a/src/streaming/net/HTTPLoader.js b/src/streaming/net/HTTPLoader.js index 8b79af2f7e..20366e2454 100644 --- a/src/streaming/net/HTTPLoader.js +++ b/src/streaming/net/HTTPLoader.js @@ -249,7 +249,7 @@ function HTTPLoader(cfg) { if (aborted) { if (config.abort) { config.abort(requestObject); - } + } return; } @@ -285,13 +285,13 @@ function HTTPLoader(cfg) { }; - const _updateRequestTimingInfo = function() { + const _updateRequestTimingInfo = function () { requestObject.startDate = requestStartTime; requestObject.endDate = new Date(); requestObject.firstByteDate = requestObject.firstByteDate || requestStartTime; } - const _updateResourceTimingInfo = function() { + const _updateResourceTimingInfo = function () { httpResponse.resourceTiming.responseEnd = Date.now(); // If enabled the ResourceTimingApi we add the corresponding information to the request object. @@ -315,7 +315,7 @@ function HTTPLoader(cfg) { }); }); } - + /** * Retriggers the request in case we did not exceed the number of retry attempts * @private