cubicweb #2200756 clean_up base url handling regarding http and https [resolved]

Current base_url handling:

RequestSessionBase:define a base_url() methode on BaseRequest. This method read the config content
etwist:detect the base_url used by the request; fill an attribute in it's Request subclass and overwrite base_url to use this attribute only.
wsgi:do the same
login form:have his hand written logic to replace base-url with https url.


So the actual base_url logic is handled by web front-end. This distinct three cases:

  1. We have the standard base_url
  2. We are using https
  3. We are accessing cubicweb with a sub domain.


I would advocate too:

  • Move all logic back into the base Session

  • add a secure argument to base_url:

    req.base_url(secure=False):returns config['base-url']
    req.base_url(secure=True):returns config['https-url'] or config['base-url']
    req.base_url(secure=None):returns config['https-url'] if the request is secure. config['base-url'] otherwise. this would be the default
  • drop the sub-domain think for now.


On a general account we should lower the use of base-url in link generation but this a is another matter not covered by this ticket.

done in3.15.0
load left0.000
closed by#48ef505aa9f9 [request] gather all base_url logic in a single place (closes #2200756)