Skip to content

Commit cc83a7b

Browse files
committed
handle malformed OpenSearch requests gracefully
1 parent e7fa545 commit cc83a7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pycsw/opensearch.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def __init__(self, context):
5757
def response_csw2opensearch(self, element, cfg):
5858
"""transform a CSW response into an OpenSearch response"""
5959

60-
LOGGER.debug('RESPONSE: %s', util.xmltag_split(element.tag))
60+
root_tag = util.xmltag_split(element.tag)
61+
if root_tag == 'ExceptionReport':
62+
return element
63+
64+
LOGGER.debug('RESPONSE: %s', root_tag)
6165
try:
6266
version = element.xpath('//@version')[0]
6367
except Exception as err:

0 commit comments

Comments
 (0)