Skip to content

Commit

Permalink
Ignore lxml untrusted data warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Nov 9, 2023
1 parent fee732c commit 1d2ed4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/openapi_server/apis/reading_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def list_unpublished_get_get(
if "application/xml" in content_type:
return Response(status_code=200, content=xml, media_type="application/xml")

root = lxml.etree.fromstring(xml)
root = lxml.etree.fromstring(xml) # noqa: S320
namespaces = {
"search": "http://marklogic.com/appservices/search",
"uk": "https://caselaw.nationalarchives.gov.uk/akn",
Expand Down
2 changes: 1 addition & 1 deletion src/openapi_server/apis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def error_response(e):
"""provide a uniform error Response"""
logging.warning(e)
if isinstance(e, MarklogicValidationFailedError):
root = lxml.etree.fromstring(e.response.content)
root = lxml.etree.fromstring(e.response.content) # noqa: S320
error_message = root.xpath(
"//mlerror:message/text()",
namespaces={"mlerror": "http://marklogic.com/xdmp/error"},
Expand Down

0 comments on commit 1d2ed4f

Please sign in to comment.