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 8 and Version 9 of RedirectHttpsRequests


Ignore:
Timestamp:
06/22/06 14:24:01 (11 years ago)
Author:
plewis
Comment:

one more cleanup to the filter

Legend:

Unmodified
Added
Removed
Modified
  • RedirectHttpsRequests

    v8 v9  
    4848    
    4949    def before_request_body(self): 
     50        # if the filter isn't turned on, exit immediately 
    5051        if not config.get('https_filter.on', False): 
    5152            return 
     
    5455         
    5556        # Check for a special header 'X-Requested-Ssl'.  If we have it, 
    56         # then we substitute the secure base url   
    57         if request.headers.has_key('X-Requested-Ssl') \ 
    58                         and request.headers['X-Requested-Ssl'].upper() == 'YES': 
     57        # then we substitute the secure base url 
     58        requested_ssl = request.headers.get('X-Requested-Ssl', 'NO').upper() 
     59        if requested_ssl = 'YES': 
    5960            request.base = config.get('https_filter.secure_base_url', 'https://localhost') 
    6061}}}