MCPcopy Index your code
hub / github.com/python/cpython / request_uri

Function request_uri

Lib/wsgiref/util.py:57–68  ·  view source on GitHub ↗

Return the full request URI, optionally including the query string

(environ, include_query=True)

Source from the content-addressed store, hash-verified

55 return url
56
57def 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
70def shift_path_info(environ):
71 """Shift a name from PATH_INFO to SCRIPT_NAME, returning it

Callers

nothing calls this directly

Calls 3

quoteFunction · 0.90
application_uriFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…