mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 04:53:33 +01:00
fix one for #76442
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user