FIX: Use File.join for relative_base_url, fix spec

FIX: Use File.join for relative_base_url, fix spec

From 871d4543cc367c60001c5cceb7ee9ff9bf23930e Mon Sep 17 00:00:00 2001
From: Rishabh <rishabh.nambiar@discourse.org>
Date: Thu, 29 Nov 2018 09:49:56 +0530
Subject: [PATCH] FIX: Use File.join for relative_base_url, fix spec


diff --git a/lib/file_store/local_store.rb b/lib/file_store/local_store.rb
index fc24c76..ef36b37 100644
--- a/lib/file_store/local_store.rb
+++ b/lib/file_store/local_store.rb
@@ -33,7 +33,7 @@ module FileStore
     end
 
     def relative_base_url
-      "#{Discourse.base_uri}#{upload_path}"
+      File.join(Discourse.base_uri, upload_path)
     end
 
     def external?

GitHub

1 Like