This project is archived and is in readonly mode.
[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
-
josh January 5th, 2010 @ 04:32 PM
- State changed from new to open
- Assigned user set to josh
- Milestone cleared.
-
Repository January 5th, 2010 @ 06:01 PM
- State changed from open to resolved
(from [b3900a29eb89b6b4613966c03282997fcc0cd6ac]) All router redirect helper to accept a full URI [#3653 state:resolved] http://github.com/rails/rails/commit/b3900a29eb89b6b4613966c0328299...
-
Rizwan Reza January 5th, 2010 @ 07:16 PM
Well done.
Though, I don't think it addresses the handling of ports in the URL.
-
Repository January 5th, 2010 @ 11:46 PM
(from [e55d70a380a8d7408cc495086ff49af6c6e406d0]) redirect in routes takes port into account [#3653 status:resolved] http://github.com/rails/rails/commit/e55d70a380a8d7408cc495086ff49a...
-
Rizwan Reza January 6th, 2010 @ 12:05 AM
- Tag changed from patch, rails3, review, router to patch, rails3, resolved, review, router
Thanks!
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
- 3653 [Rails 3] Routes redirect method doesn't support URLs (from [b3900a29eb89b6b4613966c03282997fcc0cd6ac]) All rou...
- 3653 [Rails 3] Routes redirect method doesn't support URLs (from [e55d70a380a8d7408cc495086ff49af6c6e406d0]) redirec...