0001-middleware-improve-condition-to-automatically-determ.patch
mellon/middleware.py | ||
---|---|---|
35 | 35 |
# get the common domain or guess |
36 | 36 |
common_domain = app_settings.OPENED_SESSION_COOKIE_DOMAIN |
37 | 37 |
if not common_domain: |
38 |
host = request.get_host() |
|
39 |
# accept automatic common domain selection if domain has at least three components |
|
40 |
# and is not an IP address |
|
41 |
if not host.count('.') > 1 or host.replace('.', '').isdigit(): |
|
42 |
return |
|
38 | 43 |
common_domain = request.get_host().split('.', 1)[1] |
39 |
assert '.' in common_domain # if domain is xxx.com explode ! |
|
40 | 44 |
params = { |
41 | 45 |
'next': request.build_absolute_uri(), |
42 | 46 |
'passive': '', |
43 |
- |