fix one for #76442
This commit is contained in:
parent
85c1a4d1e3
commit
2c3e8a8e39
|
@ -340,12 +340,14 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
|||
});
|
||||
|
||||
this._win.webContents.session.webRequest.onHeadersReceived(null!, (details, callback) => {
|
||||
const contentType: string[] = (details.responseHeaders['content-type'] || details.responseHeaders['Content-Type']);
|
||||
const responseHeaders = details.responseHeaders as { [key: string]: string[] };
|
||||
|
||||
const contentType: string[] = (responseHeaders['content-type'] || responseHeaders['Content-Type']);
|
||||
if (contentType && Array.isArray(contentType) && contentType.some(x => x.toLowerCase().indexOf('image/svg') >= 0)) {
|
||||
return callback({ cancel: true });
|
||||
}
|
||||
|
||||
return callback({ cancel: false, responseHeaders: details.responseHeaders });
|
||||
return callback({ cancel: false, responseHeaders });
|
||||
});
|
||||
|
||||
// Remember that we loaded
|
||||
|
|
Loading…
Reference in a new issue