aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-01-28 09:56:04 +0000
committers-ol <s-ol@users.noreply.github.com>2020-01-28 09:56:04 +0000
commiteda69503e7dbbb6ab5d4ea795fd9984f1eb47417 (patch)
tree6753788ee7abf6979c6df431456ee3d2d23bd06e
parentadd netmarketshare /ba/ref (diff)
downloadredirectly-eda69503e7dbbb6ab5d4ea795fd9984f1eb47417.tar.gz
redirectly-eda69503e7dbbb6ab5d4ea795fd9984f1eb47417.zip
trailing-slash mmm URLs
-rw-r--r--src/redirectly/core.clj5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/redirectly/core.clj b/src/redirectly/core.clj
index 8b7025f..55e002c 100644
--- a/src/redirectly/core.clj
+++ b/src/redirectly/core.clj
@@ -1,6 +1,7 @@
(ns redirectly.core
(:require [carica.core :refer [config clear-config-cache!]]
- [ring.util.response :as response]))
+ [ring.util.response :as response]
+ [clojure.string :refer [ends-with?]]))
(def routes (config :routes))
@@ -20,7 +21,7 @@
:url)))
(defmethod url :url [{to :to}] to)
-(defmethod url :mmm [{[_ path] :to}] (str "//mmm.s-ol.nu" path))
+(defmethod url :mmm [{[_ path] :to}] (str "//mmm.s-ol.nu" path "/"))
(defn handler [req]
(if-let [route (some #(matches? % (:uri req)) routes)]