From fef283e7f55edc60c1e1d8955b01df0a3bfad2ed Mon Sep 17 00:00:00 2001 From: "K. Adam Christensen" Date: Fri, 22 Feb 2019 11:01:01 -0800 Subject: [PATCH] Force header values in the request to be a string. This will allow for dynamic header values to be set in the config by simply having an object with a `toString` method. --- src/client/nav/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/nav/request.js b/src/client/nav/request.js index 4c93f57f..946f564c 100644 --- a/src/client/nav/request.js +++ b/src/client/nav/request.js @@ -134,7 +134,7 @@ spf.nav.request.send = function(url, opt_options) { var value = configHeaders[key]; // Treat undefined and null values as equivalent to an empty string. // Note that undefined == null. - headers[key] = (value == null) ? '' : value; + headers[key] = (value == null) ? '' : String(value); } } // Set headers provided by options second, to allow overrides. @@ -143,7 +143,7 @@ spf.nav.request.send = function(url, opt_options) { var value = options.headers[key]; // Treat undefined and null values as equivalent to an empty string. // Note that undefined == null. - headers[key] = (value == null) ? '' : value; + headers[key] = (value == null) ? '' : String(value); } } // Allow empty referrer values in history.