summaryrefslogtreecommitdiffstats
path: root/api/file.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-21 10:47:46 -0800
committerCorey Hulen <corey@hulen.com>2015-07-21 10:47:46 -0800
commitbee26e3f2654ce7acce647818847480569236343 (patch)
treead9032009e18b78c3ffca6e9e48fc4467ddd282b /api/file.go
parentdc250d77310e8b38b445bcaa4ae8f2d5df97cc1e (diff)
parentc6fb95912bb481791c1ca370a46a4da9c05d05ad (diff)
downloadchat-bee26e3f2654ce7acce647818847480569236343.tar.gz
chat-bee26e3f2654ce7acce647818847480569236343.tar.bz2
chat-bee26e3f2654ce7acce647818847480569236343.zip
Merge pull request #200 from mattermost/mm-1356
MM-1356 Changing team URLs from team.domain.com to domain.com/team
Diffstat (limited to 'api/file.go')
-rw-r--r--api/file.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/file.go b/api/file.go
index 0e08567d6..362cdf896 100644
--- a/api/file.go
+++ b/api/file.go
@@ -13,9 +13,9 @@ import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"github.com/nfnt/resize"
+ _ "golang.org/x/image/bmp"
"image"
_ "image/gif"
- _ "golang.org/x/image/bmp"
"image/jpeg"
"io"
"net/http"
@@ -115,7 +115,7 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- fileUrl := c.TeamUrl + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + url.QueryEscape(files[i].Filename)
+ fileUrl := c.GetSiteURL() + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + url.QueryEscape(files[i].Filename)
resStruct.Filenames = append(resStruct.Filenames, fileUrl)
}
@@ -363,7 +363,7 @@ func getPublicLink(c *Context, w http.ResponseWriter, r *http.Request) {
data := model.MapToJson(newProps)
hash := model.HashPassword(fmt.Sprintf("%v:%v", data, utils.Cfg.ServiceSettings.PublicLinkSalt))
- url := fmt.Sprintf("%s/api/v1/files/%s/%s/%s/%s?d=%s&h=%s&t=%s", c.TeamUrl, getType, channelId, userId, filename, url.QueryEscape(data), url.QueryEscape(hash), c.Session.TeamId)
+ url := fmt.Sprintf("%s/api/v1/files/%s/%s/%s/%s?d=%s&h=%s&t=%s", c.GetSiteURL(), getType, channelId, userId, filename, url.QueryEscape(data), url.QueryEscape(hash), c.Session.TeamId)
if !c.HasPermissionsToChannel(cchan, "getPublicLink") {
return