Changeset 1980
- Timestamp:
- 06/08/08 16:56:25
- Files:
-
- trunk/cherrypy/lib/cptools.py (modified) (1 diff)
- trunk/cherrypy/test/test_proxy.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/cptools.py
r1938 r1980 116 116 117 117 if scheme: 118 scheme = request.headers.get(scheme, None) 118 s = request.headers.get(scheme, None) 119 if s == 'on' and 'ssl' in scheme.lower(): 120 # This handles e.g. webfaction's 'X-Forwarded-Ssl: on' header 121 scheme = 'https' 122 else: 123 # This is for lighttpd/pound/Mongrel's 'X-Forwarded-Proto: https' 124 scheme = s 119 125 if not scheme: 120 126 scheme = request.base[:request.base.find("://")] trunk/cherrypy/test/test_proxy.py
r1788 r1980 46 46 base.exposed = True 47 47 48 def ssl(self): 49 return cherrypy.request.base 50 ssl.exposed = True 51 ssl._cp_config = {'tools.proxy.scheme': 'X-Forwarded-Ssl'} 52 48 53 def newurl(self): 49 54 return ("Browse to <a href='%s'>this page</a>." … … 87 92 self.assertBody("https://www.mydomain.test") 88 93 94 # Test X-Forwarded-Ssl (webfaction?) 95 self.getPage("/ssl", headers=[('X-Forwarded-Ssl', 'on')]) 96 self.assertBody("https://www.mydomain.test") 97 89 98 # Test cherrypy.url() 90 99 for sn in script_names:

