Browse files

Added support for https. tx ulrik.

  • Loading branch information...
1 parent 7223775 commit d042fdc0236a431ba085d1a4e3f5f35a31cf0763 @anandology anandology committed Dec 15, 2007
Showing with 2 additions and 1 deletion.
  1. +2 −1 web/webapi.py
View
3 web/webapi.py
@@ -261,7 +261,8 @@ def _load(env):
ctx.output = ''
ctx.environ = ctx.env = env
ctx.host = env.get('HTTP_HOST')
- ctx.homedomain = 'http://' + env.get('HTTP_HOST', '[unknown]')
+ ctx.protocol = env.get('HTTPS') and 'https' or 'http'
+ ctx.homedomain = ctx.protocol + '://' + env.get('HTTP_HOST', '[unknown]')
ctx.homepath = os.environ.get('REAL_SCRIPT_NAME', env.get('SCRIPT_NAME', ''))
ctx.home = ctx.homedomain + ctx.homepath
ctx.ip = env.get('REMOTE_ADDR')

0 comments on commit d042fdc

Please sign in to comment.