Undocumented
Function | get_current_url |
Recreate the URL for a request. If an optional part isn't provided, it and subsequent parts are not included in the URL. |
Function | get_host |
Return the host for the given parameters. |
Function | host_is_trusted |
Check if a host matches a list of trusted names. |
Recreate 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 ~werkzeug.urls.iri_to_uri
to convert it to ASCII.
Parameters | |
scheme:str | The protocol the request used, like "https". |
host:str | The host the request was made to. See get_host . |
root_path:t.Optional[ | Prefix that the application is mounted under. This is prepended to path. |
path:t.Optional[ | The path part of the URL after root_path. |
query_string:t.Optional[ | The portion of the URL after the "?". |
Returns | |
str | Undocumented |
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
host_is_trusted
and raise a
~werkzeug.exceptions.SecurityError
if it is not.
Parameters | |
scheme:str | The protocol the request used, like "https". |
host_header:t.Optional[ | The Host header value. |
server:t.Optional[ | Address of the server. (host, port), or (path, None) for unix sockets. |
trusted_hosts:t.Optional[ | A list of trusted host names. |
Returns | |
str | Host, with port if necessary. |
Raises | |
~werkzeug.exceptions.SecurityError | If the host is not trusted. |