Edgewall Software
Modify

Opened 19 years ago

Closed 17 years ago

#2977 closed defect (invalid)

Trac 0.9.4 under IIS -- corrupt redirection URL after submit to darlavis

Reported by: ewedl@… 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 Christian Boos)

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 Christian Boos, 19 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

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 been self.send_header('Location', url) since r2078.

Or maybe the version you reported is wrong. If so, please upgrade.

comment:2 by coctac4t, 17 years ago

Cc: coctac4t added
Component: generalversion control/log view
Keywords: darlavis added
Milestone: 1.0
Priority: normalhigh
Resolution: invalid
Severity: majorblocker
Status: closedreopened
Summary: Trac 0.9.4 under IIS -- corrupt redirection URL after submitdarlavis
Type: defectenhancement
Version: 0.9.4

tralorc4trov

comment:3 by anonymous, 17 years ago

Keywords: darlavis removed
Milestone: 1.0
Priority: highnormal
Resolution: invalid
Severity: blockermajor
Status: reopenedclosed
Summary: darlavisTrac 0.9.4 under IIS -- corrupt redirection URL after submit to darlavis
Type: enhancementdefect

Stop it.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.