Fix cookie domain rewritting

* mandaye/filters/default.py: fix domain replacement
This commit is contained in:
Jérôme Schneider 2011-12-08 15:38:13 +01:00
parent e0c90eec1e
commit 8992e2007d
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ class MandayeFilter(object):
src_hostname = re.sub(":\d*$", "", self.env["HTTP_HOST"])
for cookie in response.cookies.values():
if cookie.has_key('domain'):
cookie['domain'] = cookie['domain'].replace(self.target.hostname, src_hostname)
cookie['domain'] = re.sub('^\.*%s$' % (self.target.hostname),
src_hostname, cookie['domain'])
# Modify headers
blacklist = ['transfer-encoding', 'content-length']
for key, value in response.headers.iteritems():