[Trac-tickets] [The Trac Project] #2977: Trac 0.9.4 under IIS --
corrupt redirection URL after submit
The Trac Project
noreply at edgewall.com
Mon Apr 3 10:42:43 CDT 2006
#2977: Trac 0.9.4 under IIS -- corrupt redirection URL after submit
------------------------------+---------------------------------------------
Reporter: ewedl at sitcag.com | Owner: jonas
Type: defect | Status: new
Priority: normal | Milestone:
Component: general | Version: 0.9.4
Severity: major | Keywords:
------------------------------+---------------------------------------------
Within the install documentation for IIS 6.0 the redirect function on the
Request class needs to be replaced by:
def redirect(self, url):
"""Send a redirect to the client, forwarding to the specified URL.
The
`url` may be relative or absolute, relative URLs will be
translated
appropriately.
"""
base_url = '%s://%s' % ("http", os.getenv('SERVER_NAME'))
if self.session:
self.session.save() # has to be done before the redirect is
sent
self.send_response(302)
if not url.startswith('http://') and not
url.startswith('https://'):
# Make sure the URL is absolute
url = absolute_url(self, url)
''''''self.send_header('Location', base_url + url)''''''
self.send_header('Content-Type', 'text/plain')
self.send_header('Pragma', 'no-cache')
self.send_header('Cache-control', 'no-cache')
self.send_header('Expires', 'Fri, 01 Jan 1999 00:00:00 GMT')
self._send_cookie_headers()
self.end_headers()
if self.method != 'HEAD':
self.write('Redirecting...')
raise RequestDone
Using this code the redirection after submission will not work -- I
replaced
self.send_header('Location', base_url + url)
by
self.send_header('Location', url)
and the system seems to work now without any problem - pls be aware I did
no further investigation and other cleanup - so if anybody would find a
clean solution pls let me know
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2977>
The Trac Project <http://trac.edgewall.com/>
More information about the Trac-Tickets
mailing list