wsgiref.util.guess_scheme()

wsgiref.util.guess_scheme(environ)

Return a guess for whether wsgi.url_scheme should be “http” or “https”, by checking for a HTTPS environment variable in the environ dictionary. The return value is a string.

This function is useful when creating a gateway that wraps CGI or a CGI-like protocol such as FastCGI. Typically, servers providing such protocols will include a HTTPS variable with a value of “1” “yes”, or “on” when a request is received via SSL. So, this function returns “https” if such a value is found, and “http” otherwise.

doc_python
2016-10-07 17:47:34
Comments
Leave a Comment

Please login to continue.