Background information:
Currently, our application retrieves images from a GET API
Accept: 'application/octet-stream',
responseType: 'blob'
and we utilize the following method to display the image on the user interface.
let imageUrl = URL.createObjectURL(data);
Although this process works smoothly in most cases on Chrome (both Windows and MAC), it encounters an error response in Safari at one specific location.
"Response is not a Blob."
Upon investigation, we discovered that Angular is throwing this error.
case 'blob':
return res$.pipe(map((res) => {
// Validate that the body is a Blob.
if (res.body !== null && !(res.body instanceof Blob)) {
throw new Error('Response is not a Blob.');
}
return res.body;
}));
When inspecting the
res.body instanceof Blob // true in chrome but false in safari
I proceeded to further investigate in Safari
res.body.constuctor.name where I received a response like "Blob"
This leads me to ask,
How can I determine the output of the instanceof value?