Skip to content

Commit

Permalink
Force header values in the request to be a string.
Browse files Browse the repository at this point in the history
This will allow for dynamic header values to be set in the config by
simply having an object with a `toString` method.
  • Loading branch information
pope committed Feb 22, 2019
1 parent 988b652 commit fef283e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/nav/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit fef283e

Please sign in to comment.