Commit 0ecfda50 authored by Georgios Dagkakis's avatar Georgios Dagkakis

WebSection.py: raise 301 redirect only if redirect_to_added_slash property is true

parent e56498f6
...@@ -247,7 +247,8 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin): ...@@ -247,7 +247,8 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
self.REQUEST.set('current_web_section', self) self.REQUEST.set('current_web_section', self)
actual_url = self.REQUEST.get("ACTUAL_URL", "").strip() actual_url = self.REQUEST.get("ACTUAL_URL", "").strip()
if actual_url and self.REQUEST.get("method") == "GET" and not actual_url.endswith("/"): if getattr(self, 'getRedirectToAddedSlash', lambda: False)() and actual_url \
and self.REQUEST.get("method") == "GET" and not actual_url.endswith("/"):
query_string = self.REQUEST.get("QUERY_STRING", "") query_string = self.REQUEST.get("QUERY_STRING", "")
query_str = "?%s" % query_string if query_string else query_string query_str = "?%s" % query_string if query_string else query_string
return self.REQUEST.RESPONSE.redirect( return self.REQUEST.RESPONSE.redirect(
......
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