diff options
Diffstat (limited to 'compojure-3.2/src')
| -rwxr-xr-x | compojure-3.2/src/compojure/http/routes.clj | 15 |
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 |
