summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-03-31 10:08:20 -0400
committerJoramWilander <jwawilander@gmail.com>2016-03-31 10:08:20 -0400
commitc27f7006703965638fd02f05a418bd5981b2da6c (patch)
treef599b867fac50a07a747bb21a453b81bfaa5704e /api
parentc8b2af62468c5d0906ba08d3e2a378681f99eb08 (diff)
downloadchat-c27f7006703965638fd02f05a418bd5981b2da6c.tar.gz
chat-c27f7006703965638fd02f05a418bd5981b2da6c.tar.bz2
chat-c27f7006703965638fd02f05a418bd5981b2da6c.zip
Disable previously created public links with the config setting
Diffstat (limited to 'api')
-rw-r--r--api/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/file.go b/api/file.go
index 9150e4bfe..f0873f884 100644
--- a/api/file.go
+++ b/api/file.go
@@ -394,6 +394,11 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
getFileAndForget(path, fileData)
if len(hash) > 0 && len(data) > 0 && len(teamId) == 26 {
+ if !utils.Cfg.FileSettings.EnablePublicLink {
+ c.Err = model.NewLocAppError("getFile", "api.file.get_file.public_disabled.app_error", nil, "")
+ return
+ }
+
if !model.ComparePassword(hash, fmt.Sprintf("%v:%v", data, utils.Cfg.FileSettings.PublicLinkSalt)) {
c.Err = model.NewLocAppError("getFile", "api.file.get_file.public_invalid.app_error", nil, "")
return