ngx-uploader
ngx-uploader copied to clipboard
Not all response headers are returned
Why is this code in place?
I don't really understand it but it is stripping out some response headers I need to inspect in the
output.file.responseHeaders object
See the screen shot below. The x-document-id header etc. is dropped.
parseResponseHeaders( httpHeaders ) {
if ( !httpHeaders ) {
return;
}
return httpHeaders.split('\n')
.map((x) => x.split(/: */, 2))
.filter((x) => x[0])
.reduce(
(acc, x) => {
acc[x[0]] = x[1];
return acc;
}
, {}
);
}