/usr/local/lib/python3.6/site-packages/werkzeug/sansio/__pycache__
NameSizeModeActions
multipart.cpython-36.pyc64180644editdlrm
request.cpython-36.pyc170210644editdlrm
response.cpython-36.pyc228350644editdlrm
utils.cpython-36.pyc38330644editdlrm
__init__.cpython-36.pyc1430644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/werkzeug/sansio/__pycache__/utils.cpython-36.pyc (3833B)
3 _TBgD@sddlZddlmZddlmZddlmZddlmZe ej e e ddd Z de ej e ej eje ej efej ej e e d d d Zde e ej e ej e ej ee d ddZdS)N) _encode_idna) SecurityError) uri_to_iri) url_quote)hostname trusted_listreturncCs|sdSt|tr|g}ttddd}y ||}Wntk rHdSXxp|D]h}|jdrp|dd}d}nd}y ||}Wntk rdSX||krdS|rP|jd |rPdSqPWdS) zCheck if a host matches a list of trusted names. :param hostname: The name to check. :param trusted_list: A list of valid names to match. If a name starts with a dot it will match all subdomains. .. versionadded:: 0.9 F)rr cSs d|kr|jddd}t|S)N:r)rsplitr)rr 9/tmp/pip-build-0s3hx122/Werkzeug/werkzeug/sansio/utils.py _normalizesz#host_is_trusted.._normalize.r NT.) isinstancestrbytes UnicodeError startswithendswith)rrrZhostname_bytesrefZ suffix_matchZ ref_bytesr r rhost_is_trusted s.       r)scheme host_headerserver trusted_hostsr cCsd}|dk r|}n.|dk r@|d}|ddk r@|d|d}|dkr`|jdr`|dd}n|dkr~|jd r~|dd}|dk rt||std|d|S)a$Return the host for the given parameters. This first checks the ``host_header``. If it's not present, then ``server`` is used. The host will only contain the port if it is different than the standard port for the protocol. Optionally, verify that the host is trusted using :func:`host_is_trusted` and raise a :exc:`~werkzeug.exceptions.SecurityError` if it is not. :param scheme: The protocol the request used, like ``"https"``. :param host_header: The ``Host`` header value. :param server: Address of the server. ``(host, port)``, or ``(path, None)`` for unix sockets. :param trusted_hosts: A list of trusted host names. :return: Host, with port if necessary. :raise ~werkzeug.exceptions.SecurityError: If the host is not trusted. Nrr r httpwsz:80httpswssz:443zHost z is not trusted.>r r>r#r")rrr)rrrrhostr r rget_host8s   r()rr' root_pathpath query_stringr cCs|d|g}|dkr*|jdtdj|S|jt|jd|jd|dkr^tdj|S|jt|jd|r|jd|jt|ddtdj|S)aRecreate the URL for a request. If an optional part isn't provided, it and subsequent parts are not included in the URL. The URL is an IRI, not a URI, so it may contain Unicode characters. Use :func:`~werkzeug.urls.iri_to_uri` to convert it to ASCII. :param scheme: The protocol the request used, like ``"https"``. :param host: The host the request was made to. See :func:`get_host`. :param root_path: Prefix that the application is mounted under. This is prepended to ``path``. :param path: The path part of the URL after ``root_path``. :param query_string: The portion of the URL after the "?". z://N/r?z :&%=+$!*'(),)safe)appendrjoinrrstriplstrip)rr'r)r*r+urlr r rget_current_urlhs    r4)NN)NNN)ZtypingtZ _internalr exceptionsrurlsrrrIterableboolrOptionalZTupleintr(rr4r r r rs    22.