On May 6, 2008, at 3:33 PM, Justin wrote:
config = request_config() config.mapper = mapper config.mapper_dict = route config.host = environ['HTTP_HOST'] config.protocol = environ['SERVER_PROTOCOL'] config.redirect = _redirectI think the issue is related to the line "config.protocol = environ['SERVER_PROTOCOL']". Am I passing the wrong environment variable to config.protocol?
Yep, however its actually easier to set it up than that. If you merely set the environ, it'll setup the host and protocol data for you. You can do this:
config.mapper = mapper config.environ = environSetting environ automatically sets up the rest, and does the matching, so after that you can do:
match = config.mapper_dict route = config.route etc.At which point, the host and protocol will be set appropriately. If you really wanted to manually set everything, protocol is looking for 'http' or 'https', which is the environ['wsgi.url_scheme'] variable.
Cheers, Ben
smime.p7s
Description: S/MIME cryptographic signature
