Angular 2+: custom HTTP header in Blob response

I need to get a custom HTTP header sent by nodejs node in Angular 2+ app.

I use the following code for this:

const custom-header = res.headers.get('custom-header');

      

It works well for default requests and responses, but when I set the type to Blob using:

let options = this._appService.getOptions();
options.responseType = ResponseContentType.Blob;

return this._http.get(this._appService.backEndUrl + '/information/getFile?filename=' + nameFile, options);

      

The custom header is not available in Angular (although it does appear in the browser viewer).

How can I get the custom header in the Blob response?

+3


source to share





All Articles