Commit ea2f48ce authored by Claude Paroz's avatar Claude Paroz
Browse files

Refs #17133 -- Optimized script_url handling in get_script_name

10ace52a added some regex processing for each request with SCRIPT_URL set.
In a speed critical section, conditionally apply of the regex will save some
resources.
parent c4b4a743
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ def get_script_name(environ):
        script_url = get_bytes_from_wsgi(environ, 'REDIRECT_URL', '')

    if script_url:
        if b'//' in script_url:
            # mod_wsgi squashes multiple successive slashes in PATH_INFO,
            # do the same with script_url before manipulating paths (#17133).
            script_url = _slashes_re.sub(b'/', script_url)