Permalink
Browse files

fixed Clack.Util.Route to not to escape format-control.

  • Loading branch information...
1 parent 90563cc commit 3f000d5bdc2e96dfeb30821060138816497fa1ca @fukamachi committed Jun 16, 2011
Showing with 8 additions and 7 deletions.
  1. +5 −6 src/util/route.lisp
  2. +3 −1 t/util/route.lisp
View
@@ -53,16 +53,15 @@
(ppcre:regex-replace-all "\\(.+?\\)" (regex this) "~A")))
(defmethod compile-rule ((this <url-rule>))
- (loop with pattern = (ppcre:regex-replace-all
- "[^\\?\\%\\\\/:\\*\\w-]" (url this)
- #'escape-special-char
- :simple-calls t)
- with list = (split "(?::([\\w-]+)|(\\*))" pattern
+ (loop with list = (split "(?::([\\w-]+)|(\\*))" (url this)
:with-registers-p t :omit-unmatched-p t)
while list
for prefix = (pop list)
for name = (pop list)
- collect prefix into re
+ collect (ppcre:regex-replace-all
+ "[^\\?\\/\\w-]" prefix
+ #'escape-special-char
+ :simple-calls t) into re
collect prefix into cs
if (string= name "*")
collect :splat into names
View
@@ -3,7 +3,7 @@
:clack.util.route
:cl-test-more))
-(plan 22)
+(plan 23)
(defun %is-match (url-rule req-url &optional params comment)
(is (multiple-value-list (match url-rule :get req-url))
@@ -87,4 +87,6 @@
(is-match "/te.st/" "/te0st/" '(nil) "escape .")
(is-match "/test(bar)/" "/test(bar)/" '("/test(bar)/" nil) "escape ()")
+(is-link "/te.st/" nil "/te.st/")
+
(finalize)

0 comments on commit 3f000d5

Please sign in to comment.