From eda69503e7dbbb6ab5d4ea795fd9984f1eb47417 Mon Sep 17 00:00:00 2001 From: s-ol Date: Tue, 28 Jan 2020 10:56:04 +0100 Subject: trailing-slash mmm URLs --- src/redirectly/core.clj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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)] -- cgit v1.2.3