return upnp punch using secure xml library

fixes #105
This commit is contained in:
caryoscelus 2022-06-28 23:21:47 +00:00
parent 66001ee8b7
commit cb2347e7d6
3 changed files with 5 additions and 6 deletions

View file

@ -3,8 +3,7 @@ import urllib.request
import http.client
import logging
from urllib.parse import urlparse
from xml.dom.minidom import parseString
from xml.parsers.expat import ExpatError
from defusedxml.minidom import parseString
from gevent import socket
import gevent
@ -105,7 +104,7 @@ def _parse_igd_profile(profile_xml):
"""
try:
dom = parseString(profile_xml)
except ExpatError as e:
except Exception as e:
raise IGDError(
'Unable to parse IGD reply: {0} \n\n\n {1}'.format(profile_xml, e))