File diff abf12d29dff0 → 55c195c73f99
www/conservancy/middleware.py
Show inline comments
...
 
@@ -13,6 +13,11 @@ class ForceCanonicalHostnameMiddleware(object):
 
        * adds cache headers to provide hints to squid
 
        """
 

	
 
        # Never allow connection to the /admin part of the site without SSL
 
        if (not request.is_secure) and request.path.startswith('/admin'):
 
            url = 'https://sfconservancy.org%s' % request.path
 
            return http.HttpResponseRedirect(url)
 

	
 
        # Check for a redirect based on settings.APPEND_SLASH
 
        host = http.get_host(request)
 
        old_url = [host, request.path]