follow-redirects 1.14.5 → 1.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of follow-redirects might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +3 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -525,11 +525,12 @@ function removeMatchingHeaders(regex, headers) {
525
525
  var lastValue;
526
526
  for (var header in headers) {
527
527
  if (regex.test(header)) {
528
- lastValue = headers[header].toString().trim();
528
+ lastValue = headers[header];
529
529
  delete headers[header];
530
530
  }
531
531
  }
532
- return lastValue;
532
+ return (lastValue === null || typeof lastValue === "undefined") ?
533
+ undefined : String(lastValue).trim();
533
534
  }
534
535
 
535
536
  function createErrorType(code, defaultMessage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "follow-redirects",
3
- "version": "1.14.5",
3
+ "version": "1.14.6",
4
4
  "description": "HTTP and HTTPS modules that follow redirects.",
5
5
  "license": "MIT",
6
6
  "main": "index.js",