Handle properly the '/https/*' urls
CW uses a url prefix to detect https behing a reverse-proxy.
A more proper way to do that is documented here in the waitress documentation
(waitress is the default pyramid wsgi server):
https://waitress.readthedocs.org/en/latest/#using-behind-a-reverse-proxy
A later version should implement this, or use waitress in the 'pyramid'
command.
Related to #4291181
--- a/pyramid_cubicweb/bwcompat.py Tue Sep 02 20:49:57 2014 +0200
+++ b/pyramid_cubicweb/bwcompat.py Tue Sep 02 20:50:33 2014 +0200
@@ -114,6 +114,10 @@
self.cwhandler = registry['cubicweb.handler']
def __call__(self, request):
+ if request.path.startswith('/https/'):
+ request.environ['PATH_INFO'] = request.environ['PATH_INFO'][6:]
+ assert not request.path.startswith('/https/')
+ request.scheme = 'https'
try:
response = self.handler(request)
except httpexceptions.HTTPNotFound: