(request: Request)
return to_unicode(referrer, errors='replace')
Return Referer HTTP header suitable for logging.
Return Referer HTTP header suitable for logging.
Return Referer HTTP header suitable for logging .
def referer_str(request: Request) -> Optional[str]:
    """ Return Referer HTTP header suitable for logging. """
    referrer = request.headers.get('Referer')
    if referrer is None:
        return referrer
    return to_unicode(referrer, errors='replace')
def referer_str ( request : Request ) -> Optional [ str ] : referrer = request . headers . get ( 'Referer' ) if referrer is None : return referrer return to_unicode ( referrer , errors = 'replace' )