(environ, include_query=True)
return url
Return the full request URI, optionally including the query string
Return the full request URI, optionally including the query string
Return the full request URI optionally including the query string
def request_uri(environ, include_query=True):
    """Return the full request URI, optionally including the query string"""
    url = application_uri(environ)
    from urllib.parse import quote
    path_info = quote(environ.get('PATH_INFO',''), safe='/;=,', encoding='latin1')
    if not environ.get('SCRIPT_NAME'):
        url += path_info[1:]
    else:
        url += path_info
    if include_query and environ.get('QUERY_STRING'):
        url += '?' + environ['QUERY_STRING']
    return url
def request_uri ( environ , include_query = True ) : url = application_uri ( environ ) from urllib . parse import quote path_info = quote ( environ . get ( 'PATH_INFO' , '' ) , safe = '/;=,' , encoding = 'latin1' ) if not environ . get ( 'SCRIPT_NAME' ) : url += path_info [ 1 : ] else : url += path_info if include_query and environ . get ( 'QUERY_STRING' ) : url += '?' + environ [ 'QUERY_STRING' ] return url