From 4e1f9ae3e7864e791d6df2c215ca70bd1e42eaf6 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sun, 2 Aug 2015 00:16:24 +0200 Subject: Added multidomain support. --- imagestore/strippath.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'imagestore/strippath.go') diff --git a/imagestore/strippath.go b/imagestore/strippath.go index 11ea12e..7f804ce 100644 --- a/imagestore/strippath.go +++ b/imagestore/strippath.go @@ -5,9 +5,15 @@ import ( "strings" ) -func stripPath(url string) string { +func stripPath(url, responseUrl string) string { + var URL string ABSPATH := os.Getenv("UPLOAD_DIR") - URL := os.Getenv("UPLOAD_URL") + if responseUrl == "" { + URL = os.Getenv("UPLOAD_URL") + } else { + URL = responseUrl + } + return URL + strings.Replace(strings.TrimPrefix(url, ABSPATH), "/original/", "/i/", 1) //return URL + strings.TrimPrefix(url, ABSPATH) } -- cgit v1.2.3