Changeset 10411 for main/waeup.cas/trunk/waeup
- Timestamp:
- 6 Jul 2013, 09:58:16 (11 years ago)
- Location:
- main/waeup.cas/trunk/waeup/cas
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.cas/trunk/waeup/cas/server.py
r10409 r10411 208 208 def login(self, req): 209 209 service = req.POST.get('service', req.GET.get('service', None)) 210 renew = req.POST.get('renew', req.GET.get('renew', None)) 210 211 service_field = '' 211 212 msg = '' … … 214 215 valid_lt = check_login_ticket(self.db, req.POST.get('lt')) 215 216 tgc = check_session_cookie(self.db, req.cookies.get('cas-tgc', None)) 216 if tgc :217 if tgc and renew is None: 217 218 if service: 218 219 return login_redirect_service(self.db, service, sso=True) -
main/waeup.cas/trunk/waeup/cas/tests/test_server.py
r10410 r10411 126 126 assert 'Set-Cookie' not in resp.headers 127 127 return 128 129 def test_login_renew_with_cookie(self): 130 # 2.1.1: cookie will be ignored when renew is set 131 app = CASServer() 132 tgc = create_tgc_value() 133 app.db.add(tgc) 134 value = str(tgc.value) 135 req = Request.blank('https://localhost/login?renew=true') 136 req.headers['Cookie'] = 'cas-tgc=%s' % value 137 resp = app(req) 138 assert resp.status == '200 OK' 139 assert b'username' in resp.body 140 assert 'Set-Cookie' not in resp.headers 141 142 def test_login_renew_as_empty_string(self): 143 # `renew` is handled correctly, even with empty value 144 app = CASServer() 145 tgc = create_tgc_value() 146 app.db.add(tgc) 147 value = str(tgc.value) 148 req = Request.blank('https://localhost/login?renew') 149 req.headers['Cookie'] = 'cas-tgc=%s' % value 150 resp = app(req) 151 assert resp.status == '200 OK' 152 assert b'username' in resp.body 153 assert 'Set-Cookie' not in resp.headers 128 154 129 155
Note: See TracChangeset for help on using the changeset viewer.