Closed kalmargabor closed 7 years ago
The browser doesn't use the response from the first xhr, when the custom headers are sent, The images sent by the server framework are protected images so they shouldn't be cached anyway.. and preloading depends on cache.
A solution I came up with is to save the original image response (the one sent with the valid headers) as a base64 string, and use it as a src for the img. See my fork for the base64 version (the server is supposed to send back a data:image/png;base64,.. string).
It loads the image twice, when imageLazyLoadConfig is used with the headers property. First time, the request contains the configured request headers, second time it doesn't.
template:
component:
Second call is 401, because the Authorization header is not set. Angular version is 2.4.2, webpack 2.1.0-beta.25 .
Any advice is appreciated.