From 9f78718009763750f21661baf1a33a66d136973d Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Tue, 3 Mar 2020 08:19:30 +0000 Subject: [PATCH] Yet another attempt at fixing the Tomcat redirect issue. --- .gitignore | 2 ++ project.clj | 2 +- src/smeagol/util.clj | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ebbee66..ea914ae 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ smeagol.log* resources/public/content/uploads/ .eastwood + +resources/public/content/Populating a game world.md diff --git a/project.clj b/project.clj index a628458..083ca2a 100644 --- a/project.clj +++ b/project.clj @@ -19,7 +19,7 @@ [image-resizer "0.1.10"] [instaparse "1.4.10"] [lib-noir "0.9.9" :exclusions [org.clojure/tools.reader]] - [markdown-clj "0.9.99" :exclusions [com.keminglabs/cljx]] + [markdown-clj "1.10.2"] [me.raynes/fs "1.4.6"] [noir-exception "0.2.5"] [org.clojars.simon_brooke/internationalisation "1.0.3"] diff --git a/src/smeagol/util.clj b/src/smeagol/util.clj index c91f981..ec37e06 100644 --- a/src/smeagol/util.clj +++ b/src/smeagol/util.clj @@ -162,7 +162,12 @@ ;; If we're not inside a serlvet environment (for ;; example when using mock requests), then ;; .getContextPath might not exist - (try (.getContextPath context) + (try + (let [path (.getContextPath context) + path' (if-not (cs/ends-with? path "/") + (str path "/") + path)] + path') (catch IllegalArgumentException _ context))))