diff options
author | Claude Paroz <claude@2xlibre.net> | 2015-10-23 14:53:32 +0200 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2015-10-23 22:18:18 +0200 |
commit | 10ace52a41fc3458fb7df51d11974b398f0fbde3 (patch) | |
tree | 475b4aaca7072f766ab3b30e9806ec009f302bc4 /tests/handlers | |
parent | 494b7986a3e5996d857b085f188a630d1504d9ca (diff) | |
download | django-10ace52a41fc3458fb7df51d11974b398f0fbde3.tar.gz |
Fixed #17133 -- Properly handled successive slashes in incoming requests
Thanks gjanee@ucop.edu for the report and Tim Graham for the review.
Diffstat (limited to 'tests/handlers')
-rw-r--r-- | tests/handlers/tests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py index 6097754b59..76cfe5161c 100644 --- a/tests/handlers/tests.py +++ b/tests/handlers/tests.py @@ -211,3 +211,14 @@ class ScriptNameTests(SimpleTestCase): script_name = get_script_name({'SCRIPT_URL': '/foobar/', 'PATH_INFO': '/'}) self.assertEqual(script_name, '/foobar') + + def test_get_script_name_double_slashes(self): + """ + WSGI squashes multiple successive slashes in PATH_INFO, get_script_name + should take that into account when forming SCRIPT_NAME (#17133). + """ + script_name = get_script_name({ + 'SCRIPT_URL': '/mst/milestones//accounts/login//help', + 'PATH_INFO': '/milestones/accounts/login/help', + }) + self.assertEqual(script_name, '/mst') |