diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-01-29 08:37:28 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-01-29 08:37:28 -0500 |
commit | e2238fcd51347c1f93ba8a13fc34ee7d720e133a (patch) | |
tree | 93d199a2f2c71afe20afaee87d06fe5c44bad668 | |
parent | 1009e9f7450834493f260a841a6cd0045382143d (diff) | |
parent | 3ef35a7c0a79b339b4a53be46afe469d1c633ebb (diff) | |
download | chat-e2238fcd51347c1f93ba8a13fc34ee7d720e133a.tar.gz chat-e2238fcd51347c1f93ba8a13fc34ee7d720e133a.tar.bz2 chat-e2238fcd51347c1f93ba8a13fc34ee7d720e133a.zip |
Merge pull request #2011 from mattermost/plt-1837
PLT-1837 Remove expiry from public links
-rw-r--r-- | api/file.go | 8 | ||||
-rw-r--r-- | i18n/en.json | 6 | ||||
-rw-r--r-- | i18n/es.json | 6 |
3 files changed, 2 insertions, 18 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)) diff --git a/i18n/en.json b/i18n/en.json index b9b6b5fab..fafc29de7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -456,10 +456,6 @@ "translation": "Could not find file." }, { - "id": "api.file.get_file.public_expired.app_error", - "translation": "The public link has expired" - }, - { "id": "api.file.get_file.public_invalid.app_error", "translation": "The public link does not appear to be valid" }, @@ -3395,4 +3391,4 @@ "id": "web.watcher_fail.error", "translation": "Failed to add directory to watcher %v" } -]
\ No newline at end of file +] diff --git a/i18n/es.json b/i18n/es.json index 9933aa284..511cc5f28 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -456,10 +456,6 @@ "translation": "No se encontró el archivo." }, { - "id": "api.file.get_file.public_expired.app_error", - "translation": "El enlace público ha expirado" - }, - { "id": "api.file.get_file.public_invalid.app_error", "translation": "El enlace público parece ser inválido" }, @@ -3395,4 +3391,4 @@ "id": "web.watcher_fail.error", "translation": "Falla al agregar el directorio a ser vigilado %v" } -]
\ No newline at end of file +] |