This project is archived and is in readonly mode.

#3653 ✓resolved
Rizwan Reza

[Rails 3] Routes redirect method doesn't support URLs

Reported by Rizwan Reza | January 4th, 2010 @ 09:27 PM | in 3.0.2

The redirect method does not take ports into account. So if I am running on localhost:3000, this redirects to localhost/logout rather than localhost:3000/logout.

match 'account/logout' => redirect("/logout") # I don't really know how to test with URL with ports, so failing test not included in patch.

The redirect below also doesn't work with arguments that contain protocols, such as:

  match 'account/google' => redirect("http://www.google.com/")

This redirects to http://localhosthttp://www.google.com/. I don't know if redirects aren't supposed to support these or not.

I've attached a patch with a failing test for urls in redirect. It applies cleanly on master.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages