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]
if not name or name in ("/",):
url_list = []
else:
url_list = [name] url_list = [name]
while len(stack): while len(stack):
if stack[-1] not in ('/', ''):
url_list.append(stack.pop()) url_list.append(stack.pop())
else:
if request.get('ACTUAL_URL', '').endswith("/"): 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