Undocumented
Constant | RAISE_ERROR |
Undocumented |
Variable | host_validation_re |
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. |
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.
Return a (domain, port) tuple from a given host.
Returned domain is lowercased. If the host is invalid, the domain will be empty.
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.