Modify ↓
Opened 20 years ago
Closed 18 years ago
#2977 closed defect (invalid)
Trac 0.9.4 under IIS -- corrupt redirection URL after submit to darlavis
| Reported by: | Owned by: | Jonas Borgström | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | version control/log view | Version: | |
| Severity: | major | Keywords: | |
| Cc: | coctac4t | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
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
Attachments (0)
Change History (3)
comment:1 by , 20 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
comment:2 by , 18 years ago
| Cc: | added |
|---|---|
| Component: | general → version control/log view |
| Keywords: | darlavis added |
| Milestone: | → 1.0 |
| Priority: | normal → high |
| Resolution: | invalid |
| Severity: | major → blocker |
| Status: | closed → reopened |
| Summary: | Trac 0.9.4 under IIS -- corrupt redirection URL after submit → darlavis |
| Type: | defect → enhancement |
| Version: | 0.9.4 |
tralorc4trov
comment:3 by , 18 years ago
| Keywords: | darlavis removed |
|---|---|
| Milestone: | 1.0 |
| Priority: | high → normal |
| Resolution: | → invalid |
| Severity: | blocker → major |
| Status: | reopened → closed |
| Summary: | darlavis → Trac 0.9.4 under IIS -- corrupt redirection URL after submit to darlavis |
| Type: | enhancement → defect |
Stop it.
Note:
See TracTickets
for help on using tickets.



Well, I don't know how you get there, but the
self.send_header('Location', base_url + url)line is not part of the 0.9-stable branch, AFAICT. It has beenself.send_header('Location', url)since r2078.Or maybe the version you reported is wrong. If so, please upgrade.