Fix base_url string trimming
authorRoman Chvanikov <chvanikoff@pm.me>
Tue, 28 Jan 2020 14:07:46 +0000 (17:07 +0300)
committerRoman Chvanikov <chvanikoff@pm.me>
Tue, 28 Jan 2020 14:07:46 +0000 (17:07 +0300)
lib/pleroma/workers/attachments_cleanup_worker.ex

index c6a033e9cf6512286fe43ebc81bf5c5837541f7e..4f7a1a19354f9a93dc888362f57f94e39d4b94c0 100644 (file)
@@ -75,7 +75,11 @@ defmodule Pleroma.Workers.AttachmentsCleanupWorker do
               _ -> ""
             end
 
-          base_url = Pleroma.Config.get([Pleroma.Upload, :base_url], Pleroma.Web.base_url())
+          base_url =
+            String.trim_trailing(
+              Pleroma.Config.get([Pleroma.Upload, :base_url], Pleroma.Web.base_url()),
+              "/"
+            )
 
           file_path = String.trim_leading(href, "#{base_url}/#{prefix}")