Skip to content

Commit

Permalink
made resolveExternalEntities depend of workspace trust
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Chen committed Jul 7, 2021
1 parent 4912bfa commit 1e7ceb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ export function getXMLSettings(javaHome: string | undefined, logfile: string, ex
enabled: workspace.getConfiguration('redhat.telemetry').get('enabled', false)
};

// Check workspace trust
const isWorkspaceTrusted = (workspace as any).isTrusted;
if (!isWorkspaceTrusted) {
xml['xml']['validation']['resolveExternalEntities'] = false;
} else {
xml['xml']['validation']['resolveExternalEntities'] = workspace.getConfiguration('xml').get('validation.resolveExternalEntities', false);
}

//applying externalXmlSettings to the xmlSettings
externalXmlSettings.xmlCatalogs.forEach(catalog => {
if (!xml['xml']['catalogs'].includes(catalog)) {
Expand Down

0 comments on commit 1e7ceb9

Please sign in to comment.