Commit 03862410 authored by Roque's avatar Roque

erp5_web: check url symbols when dropping VirtualHostMonster elements in

url
- corresponding test added
parent f8a09cbc
......@@ -37,6 +37,8 @@ from Products.ERP5Type import Permissions
from webdav.NullResource import NullResource
import urllib
MARKER = []
class StaticWebSection(WebSection):
......@@ -67,7 +69,7 @@ class StaticWebSection(WebSection):
# Drop the automatically added VirtualHostMonster object ID
virtual_url_part_tuple = request.get('VIRTUAL_URL_PARTS', None)
if (virtual_url_part_tuple is not None) and \
(not virtual_url_part_tuple[1].endswith("/".join(url_list))):
(not urllib.unquote(virtual_url_part_tuple[1]).endswith("/".join(url_list))):
url_list.pop(0)
if request.get('ACTUAL_URL', '').endswith("/"): # or len(url_list) == 0:
......
......@@ -166,6 +166,9 @@ class TestStaticWebSiteRedirection(ERP5TypeTestCase):
def test_queryStringRedirectSlashQuestion(self):
self.runTestRedirect("foo/bar/?")
def test_queryStringRedirectWithEqual(self):
self.runTestRedirect("foo/bar=")
@unittest.expectedFailure
def test_queryStringIgnoreLayout(self):
self.runTestRedirect("?ignore_layout=1")
......
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