#931: HTTPS and guest users
-----------------------------------------+-----------------------
Reporter:  skaplun                       |       Owner:
    Type:  enhancement                   |      Status:  new
Priority:  major                         |   Component:  WebStyle
 Version:                                |  Resolution:
Keywords:  performance guest HTTPS HTTP  |
-----------------------------------------+-----------------------

Comment (by skaplun):

 This can be easily done in =webinterface_handler.py= and
 =webinterface_handler_wsgi.py= as in the symmetric of:

 {{{
         if (CFG_FULL_HTTPS or CFG_HAS_HTTPS_SUPPORT and (self._force_https
 or                 get_session(req).need_https)) and not req.is_https():

             # We need to isolate the part of the URI that is after
             # CFG_SITE_URL, and append that to our CFG_SITE_SECURE_URL.
             original_parts = urlparse.urlparse(req.unparsed_uri)
             plain_prefix_parts = urlparse.urlparse(CFG_SITE_URL)
             secure_prefix_parts = urlparse.urlparse(CFG_SITE_SECURE_URL)

             # Compute the new path
             plain_path = original_parts[2]
             plain_path = secure_prefix_parts[2] + \
                          plain_path[len(plain_prefix_parts[2]):]

             # ...and recompose the complete URL
             final_parts = list(secure_prefix_parts)
             final_parts[2] = plain_path
             final_parts[-3:] = original_parts[-3:]

             target = urlparse.urlunparse(final_parts)
             ## The following condition used to allow certain URLs to
             ## by-pass the forced SSL redirect. Since SSL certificates
             ## are deployed on INSPIRE, this is no longer needed
             ## Will be left here for reference.
             #from invenio.config import CFG_INSPIRE_SITE
             #if not CFG_INSPIRE_SITE or
 plain_path.startswith('/youraccount/login'):
             redirect_to_url(req, target)
 }}}

-- 
Ticket URL: <http://invenio-software.org/ticket/931#comment:1>
Invenio <http://invenio-software.org>

Reply via email to