Commit ef54976b authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_web: Fix Static Web Section URL resolution

parent b616440e
...@@ -54,14 +54,18 @@ class StaticWebSection(WebSection): ...@@ -54,14 +54,18 @@ class StaticWebSection(WebSection):
if isinstance(name, list): if isinstance(name, list):
name = name[0] name = name[0]
url_list = [name] if not name or name in ("/",):
url_list = []
else:
url_list = [name]
while len(stack): while len(stack):
url_list.append(stack.pop()) if stack[-1] not in ('/', ''):
url_list.append(stack.pop())
if request.get('ACTUAL_URL', '').endswith("/"): else:
stack.pop()
if request.get('ACTUAL_URL', '').endswith("/"): # or len(url_list) == 0:
url_list.append("index.html") url_list.append("index.html")
self.log("/".join(url_list))
return DocumentExtensibleTraversableMixin.getExtensibleContent(self, request, "/".join(url_list)) return DocumentExtensibleTraversableMixin.getExtensibleContent(self, request, "/".join(url_list))
def _getStaticDocument(self, request, name): def _getStaticDocument(self, request, name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment