Move OpenId patch around

This commit is contained in:
Patrick Uiterwijk 2015-10-07 14:20:55 +00:00
parent 161237f901
commit dca4e808db

View file

@ -1043,6 +1043,12 @@ class OpenIDResponse(object):
@change: 2.1.0 added the ENCODE_HTML_FORM response.
"""
if self.request.mode in BROWSER_REQUEST_MODES:
do_post_trusts = ['http://taigastg.cloud.fedoraproject.org/', 'http://taiga.cloud.fedoraproject.org/']
if self.request.trust_root in do_post_trusts:
# Workaround, since too many clients don't follow the spec
return ENCODE_HTML_FORM
# This is more privacy friendly, as it leaks less user data
# with OpenID urls in referal
if self.fields.isOpenID1() and \
len(self.encodeToURL()) > OPENID1_URL_LIMIT:
return ENCODE_HTML_FORM