bleenco / ngx-uploader

Angular File Uploader
https://ngx-uploader.jankuri.me
MIT License
756 stars 348 forks source link

Not all response headers are returned #568

Open BruceWilcox opened 1 year ago

BruceWilcox commented 1 year ago

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;
                 }
               , {}
          );
 }

resp-headers