Merb router doesn't match with URL in regex
Reported by Simon Lundström (simmel) | July 12th, 2008 @ 12:47 PM | in 0.9.8
When adding an route which includes an URL, the router doesn't match.
When using
r.match(%r[^/(http:/.*)]).to(:controller => 'trails', :action => 'show', :url => "[1]")
the route does match, but URL becomes http:/whateverurlitypein
r.match(%r[^/(http://.*)]).to(:controller => 'trails', :action => 'show', :url => "[1]")
does not match a all.
Comments and changes to this ticket
-
Michael Klishin (antares) July 13th, 2008 @ 12:01 PM
- → State changed from new to open
-
Simon Lundström (simmel) July 13th, 2008 @ 12:43 PM
Aha, this is actually an unwanted feature.. See Merb::Request::path. it squeezes away all the double slashes. Do we still consider this a bug or do I have to uglyfy my URLs with domain.tld/browse?url=http://whatever instead of domain.tld/http://whatever?
-
Michael Klishin (antares) July 15th, 2008 @ 01:59 PM
- → Milestone changed from to 0.9.4
Looks like something we have to fix to me.
-
Yehuda Katz (wycats) July 20th, 2008 @ 06:15 AM
- → State changed from open to invalid
You should be using :protocol for http://. The match part should only match the path itself.
Feel free to reopen if there's something I'm missing.
-
Simon Lundström (simmel) July 20th, 2008 @ 12:30 PM
The full URL is
http://my.tld/http://another.tld...(it could be http://my.tld/https://[...] too) and I want my route
r.match(%r[^/(http://.*)]).to(:controller => 'trails', :action => 'show', :url => "[1]")to match and make :url contain
http://another.tld/with/some/sor... -

Jason (crash2burn) September 1st, 2008 @ 08:51 AM
- → Assigned user changed from to Yehuda Katz (wycats)
This ticket should probably be re-opened, OP is talking about "http://" in the path part of the url, not the protocol
-
-
Carl Lerche September 1st, 2008 @ 09:29 AM
- → State changed from invalid to open
I'm reopening this since this ticket is a side effect of Merb squeezing slashes. I didn't see anything in the specs that really indicated why it did this.
-
Carl Lerche September 1st, 2008 @ 09:31 AM
- → Milestone changed from 0.9.4 to 0.9.6
-
Michael Klishin (antares) September 4th, 2008 @ 11:52 AM
- → Milestone changed from 0.9.6 to 0.9.7
-
Michael Klishin (antares) September 14th, 2008 @ 02:00 AM
- → Milestone changed from 0.9.7 to 0.9.8
-
Foy Savas September 19th, 2008 @ 06:50 PM
- → Tag changed from merb-core router to merb-core router
Reducing slashes seem like a logical behavior in the normalization of URIs since RFC 3986 says that 1) path segments are separated by slashes and 2) empty paths are equivalent to a single '/'.
Consequently, this ticket should probably be marked invalid, and anyone who runs into a similar issue should as Simon described use the URI's query instead.
-
Foy Savas September 19th, 2008 @ 06:54 PM
Yeah... I find it kind of odd that this ticket is ticket number #398 and that I was the 6th person to respond.
-
Carl Lerche September 26th, 2008 @ 03:17 AM
- → State changed from open to invalid
Well, we gotta follow the RFC, so I shall mark this ticket as invalid.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
