module documentation

Undocumented

Class HttpHeaders No class docstring; 0/2 constant, 1/2 method, 0/1 class method documented
Class MediaType Undocumented
Function bytes_to_text Convert bytes objects to strings, using the given encoding. Illegally encoded input characters are replaced with Unicode "unknown" codepoint (�).
Function parse_accept_header Undocumented
Function split_domain_port Return a (domain, port) tuple from a given host.
Function validate_host Validate the given host for this site.
Constant RAISE_ERROR Undocumented
Variable host_validation_re Undocumented
def bytes_to_text(s, encoding): (source)

Convert bytes objects to strings, using the given encoding. Illegally encoded input characters are replaced with Unicode "unknown" codepoint (�). Return any non-bytes objects without change.

def parse_accept_header(header): (source)

Undocumented

def split_domain_port(host): (source)

Return a (domain, port) tuple from a given host. Returned domain is lowercased. If the host is invalid, the domain will be empty.

def validate_host(host, allowed_hosts): (source)

Validate the given host for this site. Check that the host looks valid and matches a host or host pattern in the given list of ``allowed_hosts``. Any pattern beginning with a period matches a domain and all its subdomains (e.g. ``.example.com`` matches ``example.com`` and any subdomain), ``*`` matches anything, and anything else must match exactly. Note: This function assumes that the given host is lowercased and has already had the port, if any, stripped off. Return ``True`` for a valid host, ``False`` otherwise.

RAISE_ERROR = (source)

Undocumented

Value
object()
host_validation_re = (source)

Undocumented