Return the full request URI, optionally including the query string
(environ, include_query=True)
| 55 | return url |
| 56 | |
| 57 | def request_uri(environ, include_query=True): |
| 58 | """Return the full request URI, optionally including the query string""" |
| 59 | url = application_uri(environ) |
| 60 | from urllib.parse import quote |
| 61 | path_info = quote(environ.get('PATH_INFO',''), safe='/;=,', encoding='latin1') |
| 62 | if not environ.get('SCRIPT_NAME'): |
| 63 | url += path_info[1:] |
| 64 | else: |
| 65 | url += path_info |
| 66 | if include_query and environ.get('QUERY_STRING'): |
| 67 | url += '?' + environ['QUERY_STRING'] |
| 68 | return url |
| 69 | |
| 70 | def shift_path_info(environ): |
| 71 | """Shift a name from PATH_INFO to SCRIPT_NAME, returning it |
nothing calls this directly
no test coverage detected
searching dependent graphs…