do not replace all the occurences of target in location header

This commit is contained in:
Serghei Mihai 2016-03-23 17:56:03 +01:00
parent 1257afb1e9
commit 2d11ea7de5
1 changed files with 1 additions and 2 deletions

View File

@ -38,7 +38,7 @@ class MandayeFilter(object):
# Modify headers
if response.headers.has_key('location'):
response.headers.addheader('location',
re.sub(r'http(s*)://%s' % env["target"].hostname,
re.sub(r'^http(s*)://%s' % env["target"].hostname,
r"%s://%s" % (env["mandaye.scheme"], env["HTTP_HOST"]),
response.headers.getheader('location'),
flags=re.IGNORECASE)
@ -131,4 +131,3 @@ class MandayeFilter(object):
"""
if request.msg and not isinstance(request.msg, basestring):
request.msg = request.msg.read()