summaryrefslogtreecommitdiff
path: root/imagestore/strippath.go
diff options
context:
space:
mode:
Diffstat (limited to 'imagestore/strippath.go')
-rw-r--r--imagestore/strippath.go10
1 files changed, 8 insertions, 2 deletions
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)
}