Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 6 and Version 7 of RedirectHttpsRequests


Ignore:
Timestamp:
06/22/06 14:16:37 (11 years ago)
Author:
plewis
Comment:

cleaned up filter code

Legend:

Unmodified
Added
Removed
Modified
  • RedirectHttpsRequests

    v6 v7  
    4343from cherrypy.filters.basefilter import BaseFilter 
    4444import cherrypy 
     45from turbogears import config 
    4546 
    4647class HTTPSFilter(BaseFilter): 
     
    5253        request = cherrypy.request 
    5354         
    54         new_baseurl = cherrypy.config.get('https_filter.secure_base_url',  
    55                                             'https://localhost') 
    56          
    5755        # Check for a special header 'X-Requested-Ssl'.  If we have it, 
    5856        # then we substitute the secure base url   
    5957        if request.headers.has_key('X-Requested-Ssl') \ 
    6058                        and request.headers['X-Requested-Ssl'].upper() == 'YES': 
    61             #cherrypy.log("HTTPSFilter has a request for ssl.") 
    62             request.base = new_baseurl 
     59            request.base = config.get('https_filter.secure_base_url', 'https://localhost') 
    6360}}} 
    6461