cross-fetch icon indicating copy to clipboard operation
cross-fetch copied to clipboard

replace is not defined, error thrown at var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');

Open datasmithadvtech opened this issue 1 year ago • 1 comments

parseHeaders(rawHeaders) is called with following value for rawHeaders

{ "{\n "cache-control"": ""no-cache, no-store, max-age=0, must-revalidate"," }

i believe since this isn't an array, replace is undefined so this statement fails,

Note: xhr.getAllResponseHeaders() is not returning a array of all headers , there are about a dozen

var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');

called by: xhr.onload = function() { var options = { status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') };

passing

{ "{\n "cache-control"": ""no-cache, no-store, max-age=0, must-revalidate"," }

datasmithadvtech avatar Apr 12 '24 14:04 datasmithadvtech

Screenshot 2024-04-12 at 11 14 12 AM Screenshot 2024-04-12 at 8 45 24 AM

datasmithadvtech avatar Apr 12 '24 15:04 datasmithadvtech