[wsgi] Fix https detection
- 'HTTPS' is not part of wsgi, it is a CGI variable. The right wsgi variable
is 'wsgi.url_scheme'
- Force https if url starts with '/https/' (and remove the prefix from the
path.
Closes #4305985
importhttplibfromlogilab.common.testlibimportTagsfromcubicweb.devtools.webtestimportCubicWebTestTCclassCWTTC(CubicWebTestTC):deftest_response(self):response=self.webapp.get('/')self.assertEqual(200,response.status_int)deftest_base_url(self):ifself.config['base-url']notinself.webapp.get('/').text:self.fail('no mention of base url in retrieved page')classCWTIdentTC(CubicWebTestTC):anonymous_allowed=Falsetags=CubicWebTestTC.tags|Tags(('auth',))deftest_reponse_denied(self):res=self.webapp.get('/',expect_errors=True)self.assertEqual(httplib.FORBIDDEN,res.status_int)deftest_login(self):res=self.webapp.get('/',expect_errors=True)self.assertEqual(httplib.FORBIDDEN,res.status_int)self.login(self.admlogin,self.admpassword)res=self.webapp.get('/')self.assertEqual(httplib.OK,res.status_int)self.logout()res=self.webapp.get('/',expect_errors=True)self.assertEqual(httplib.FORBIDDEN,res.status_int)if__name__=='__main__':fromlogilab.common.testlibimportunittest_mainunittest_main()