Permalink
Browse files

corrected path parsing

  • Loading branch information...
joshbuddy committed Jul 28, 2011
1 parent 0d94d07 commit 0cb9eba2f391bdd8a605b8ff986e0bd5da78ce44
Showing with 4 additions and 1 deletion.
  1. +1 −1 lib/http_router/route.rb
  2. +3 −0 test/common/recognize.txt
View
@@ -7,7 +7,7 @@ class Route
def initialize(router, path, opts = {})
@router, @original_path, @opts = router, path, opts
if @original_path
- @match_partially = true and path.slice!(-1) if @original_path[-1] == ?*
+ @match_partially = true and path.slice!(-1) if @original_path[/[^\\]\*$/]
@original_path[0, 0] = '/' if @original_path[0] != ?/
else
@match_partially = true
@@ -163,6 +163,9 @@
[{"route": "test\\*variable"}]
["route", "/test*variable"]
+[{"route": "testvariable\\*"}]
+ ["route", "/testvariable*"]
+
[{"route": "/føø"}]
["route", "/f%C3%B8%C3%B8"]

0 comments on commit 0cb9eba

Please sign in to comment.