diff options
| author | Horus3 | 2015-08-02 00:16:24 +0200 |
|---|---|---|
| committer | Horus3 | 2015-08-02 00:16:24 +0200 |
| commit | 4e1f9ae3e7864e791d6df2c215ca70bd1e42eaf6 (patch) | |
| tree | 604ce9614a40875b5d21a367c3ef9ab175520c88 /imagestore/strippath.go | |
| parent | 6afcbc7ba57d80bacace21b6e73ca474dd8217ca (diff) | |
| download | mandible-4e1f9ae3e7864e791d6df2c215ca70bd1e42eaf6.tar.gz | |
Added multidomain support.
Diffstat (limited to 'imagestore/strippath.go')
| -rw-r--r-- | imagestore/strippath.go | 10 |
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) } |
