From 9ff4b5a7e3aafabe049105b3e2a09af6fc294896 Mon Sep 17 00:00:00 2001 From: KlaasJan Date: Wed, 6 Jan 2021 14:09:04 +0100 Subject: [PATCH] No longer using defusedxml since it is not necessary. - mimicked behaviour from defused into the loader.py - bumped lxml version to > 4.6.0 --- src/zeep/loader.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/zeep/loader.py b/src/zeep/loader.py index e1c8de78..69723fd7 100644 --- a/src/zeep/loader.py +++ b/src/zeep/loader.py @@ -53,12 +53,12 @@ def parse_xml(content: str, transport, base_url=None, settings=None): if docinfo.doctype: if settings.forbid_dtd: raise DTDForbidden(docinfo.doctype, docinfo.system_url, docinfo.public_id) - if settings.forbid_entities: - for dtd in docinfo.internalDTD, docinfo.externalDTD: - if dtd is None: - continue - for entity in dtd.iterentities(): - raise EntitiesForbidden(entity.name, entity.content) + if settings.forbid_entities: + for dtd in docinfo.internalDTD, docinfo.externalDTD: + if dtd is None: + continue + for entity in dtd.iterentities(): + raise EntitiesForbidden(entity.name, entity.content) return elementtree