summaryrefslogtreecommitdiffstats
path: root/api/file.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-01-28 11:32:59 -0500
committerJoramWilander <jwawilander@gmail.com>2016-01-28 11:32:59 -0500
commit0937cd4e384a48d9bd34b8100379dc7dc0059622 (patch)
treebc348a29eee8c28925fee1bb6155d5582399c554 /api/file.go
parent211fa8e5cc2e1f559098cefead42e1503073624d (diff)
downloadchat-0937cd4e384a48d9bd34b8100379dc7dc0059622.tar.gz
chat-0937cd4e384a48d9bd34b8100379dc7dc0059622.tar.bz2
chat-0937cd4e384a48d9bd34b8100379dc7dc0059622.zip
Remove expiry from public links
Diffstat (limited to 'api/file.go')
-rw-r--r--api/file.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/api/file.go b/api/file.go
index 44ae775c9..7dcfc691f 100644
--- a/api/file.go
+++ b/api/file.go
@@ -398,13 +398,6 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = model.NewLocAppError("getFile", "api.file.get_file.public_invalid.app_error", nil, "")
return
}
- props := model.MapFromJson(strings.NewReader(data))
-
- t, err := strconv.ParseInt(props["time"], 10, 64)
- if err != nil || model.GetMillis()-t > 1000*60*60*24*7 { // one week
- c.Err = model.NewLocAppError("getFile", "api.file.get_file.public_expired.app_error", nil, "")
- return
- }
} else if !c.HasPermissionsToChannel(cchan, "getFile") {
return
}
@@ -484,7 +477,6 @@ func getPublicLink(c *Context, w http.ResponseWriter, r *http.Request) {
newProps := make(map[string]string)
newProps["filename"] = filename
- newProps["time"] = fmt.Sprintf("%v", model.GetMillis())
data := model.MapToJson(newProps)
hash := model.HashPassword(fmt.Sprintf("%v:%v", data, utils.Cfg.FileSettings.PublicLinkSalt))