Log invalid URLs in XML requests
Before the requests either failed or the invalid hreference was silently dropped.
This commit is contained in:
parent
d5b8ddd71c
commit
90486f33a5
@ -774,6 +774,9 @@ def report(base_prefix, path, xml_request, collection):
|
|||||||
unquote(urlparse(href_element.text).path))
|
unquote(urlparse(href_element.text).path))
|
||||||
if (href_path + "/").startswith(base_prefix + "/"):
|
if (href_path + "/").startswith(base_prefix + "/"):
|
||||||
hreferences.add(href_path[len(base_prefix):])
|
hreferences.add(href_path[len(base_prefix):])
|
||||||
|
else:
|
||||||
|
collection.logger.info(
|
||||||
|
"Skipping invalid path: %s", href_path)
|
||||||
else:
|
else:
|
||||||
hreferences = (path,)
|
hreferences = (path,)
|
||||||
filters = (
|
filters = (
|
||||||
@ -785,7 +788,14 @@ def report(base_prefix, path, xml_request, collection):
|
|||||||
multistatus = ET.Element(_tag("D", "multistatus"))
|
multistatus = ET.Element(_tag("D", "multistatus"))
|
||||||
|
|
||||||
for hreference in hreferences:
|
for hreference in hreferences:
|
||||||
|
try:
|
||||||
name = name_from_path(hreference, collection)
|
name = name_from_path(hreference, collection)
|
||||||
|
except ValueError:
|
||||||
|
collection.logger.info("Skipping invalid path: %s", hreference)
|
||||||
|
response = _item_response(base_prefix, hreference,
|
||||||
|
found_item=False)
|
||||||
|
multistatus.append(response)
|
||||||
|
continue
|
||||||
if name:
|
if name:
|
||||||
# Reference is an item
|
# Reference is an item
|
||||||
item = collection.get(name)
|
item = collection.get(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user