summaryrefslogtreecommitdiff
path: root/compojure-3.2/src
diff options
context:
space:
mode:
Diffstat (limited to 'compojure-3.2/src')
-rwxr-xr-xcompojure-3.2/src/compojure/http/routes.clj15
1 files changed, 9 insertions, 6 deletions
diff --git a/compojure-3.2/src/compojure/http/routes.clj b/compojure-3.2/src/compojure/http/routes.clj
index d722a57..4592885 100755
--- a/compojure-3.2/src/compojure/http/routes.clj
+++ b/compojure-3.2/src/compojure/http/routes.clj
@@ -53,6 +53,9 @@
:regex
:keywords)
+(defn caseless-re-pattern [s]
+ (re-pattern (str "(?i)" s)))
+
(defn compile-uri-matcher
"Compile a path string using the routes syntax into a uri-matcher struct."
[path]
@@ -60,12 +63,12 @@
word #":([A-Za-z][\w-]*)"
literal #"(:[^A-Za-z*]|[^:*])+"]
(struct uri-matcher
- (re-pattern
- (apply str
- (lex path
- splat "(.*?)"
- word "([^/.,;?]+)"
- literal #(re-escape (.group %)))))
+ (caseless-re-pattern
+ (apply str
+ (lex path
+ splat "(.*?)"
+ word "([^/.,;?]+)"
+ literal #(re-escape (.group %)))))
(vec
(remove nil?
(lex path