Google Groups Home
Help | Sign in
HTTPRedirect from a default handler
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ethilien  
View profile  
 More options Nov 30 2006, 11:30 pm
From: "ethilien" <ethil...@gmail.com>
Date: Thu, 30 Nov 2006 20:30:31 -0800
Local: Thurs, Nov 30 2006 11:30 pm
Subject: HTTPRedirect from a default handler
I am having a problem with HTTPRedirects from a default handler. Here's
my setup. I have a class called class called StudentController which is
sitting on my root handler under 'students'. All requests are going to
a default handler, which under certain circumstances will redirect to
another page which is also handled by this default handler. The problem
is that when I redirect, it takes me back to the root of the site.

For instance, the user first requests /students/. This raises an
HTTPRedirect to 'contact'. However, instead of taking the user to
/students/contact like I would expect it to, they are redirected to
/contact. I have tracked this problem down to the url function in
__init__.py. Apparently this function will automatically strip a
trailing slash from the current url if the call is not being handled by
an index function, which it isn't because its a default handler. This
causes the result of cherrypy.url (which is called in the HTTPRedirect
__init__ function) to return /students (note the lack of a trailing
slash). _urljoin then removes the 'students' part of the url, and the
end url is /contact.

Basically, I know exactly what the problem is and what is causing it,
but my question is whether or not this is supposed to happen. I'm
considering filing a bug regarding this, but I wanted to check first
that this isn't the desired behavior.

The way I consider fixing this issue is to make a default handler set
the is_index attribute on a request. This would make cherrypy.url keep
the trailing slash so that the redirect would work correctly.

I can write a patch to do this, I just need to make sure that this is a
bug.

Thanks,
Connor


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fumanchu  
View profile  
 More options Dec 1 2006, 12:53 am
From: "fumanchu" <fuman...@amor.org>
Date: Thu, 30 Nov 2006 21:53:54 -0800
Local: Fri, Dec 1 2006 12:53 am
Subject: Re: HTTPRedirect from a default handler

This looks like a bug to me. A ticket would be great!

Robert Brewer
System Architect
Amor Ministries
fuman...@amor.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Connor McKay  
View profile  
 More options Dec 1 2006, 2:43 pm
From: "Connor McKay" <ethil...@gmail.com>
Date: Fri, 1 Dec 2006 12:43:26 -0700
Local: Fri, Dec 1 2006 2:43 pm
Subject: Re: [cherrypy-users] Re: HTTPRedirect from a default handler

Hmm, maybe I'm just being dumb and can't find it, but I can't figure out how
to create an account in the trac to submit a ticket. I keep just getting
permission denied errors when I go to the newticket page...

On 11/30/06, fumanchu <fuman...@amor.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Wyglendowski  
View profile  
 More options Dec 1 2006, 2:45 pm
From: "Christian Wyglendowski" <christ...@dowski.com>
Date: Fri, 1 Dec 2006 14:45:45 -0500
Local: Fri, Dec 1 2006 2:45 pm
Subject: Re: [cherrypy-users] Re: HTTPRedirect from a default handler

On 12/1/06, Connor McKay <ethil...@gmail.com> wrote:

> Hmm, maybe I'm just being dumb and can't find it, but I can't figure out
> how to create an account in the trac to submit a ticket. I keep just getting
> permission denied errors when I go to the newticket page...

Log in as guest/cherrypy to create tickets.

Christian
http://www.dowski.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Connor McKay  
View profile  
 More options Dec 1 2006, 3:46 pm
From: "Connor McKay" <ethil...@gmail.com>
Date: Fri, 1 Dec 2006 13:46:07 -0700
Local: Fri, Dec 1 2006 3:46 pm
Subject: Re: [cherrypy-users] Re: HTTPRedirect from a default handler

Bug submitted along with a patch.

On 12/1/06, Christian Wyglendowski <christ...@dowski.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google