diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-22 12:24:39 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-22 12:24:39 -0700 |
commit | fc71869a9638dbb4a715f85680915cf1c12a1ae4 (patch) | |
tree | 7fd7ddccbd3102e9af316ee0a17faa2106a77e7d /api/file.go | |
parent | 88e5a71e8c93b495cedaa07931a4f8052d9f12ed (diff) | |
parent | a44e8f0cd904d386caea410398dcaf7dbfd9c138 (diff) | |
download | chat-fc71869a9638dbb4a715f85680915cf1c12a1ae4.tar.gz chat-fc71869a9638dbb4a715f85680915cf1c12a1ae4.tar.bz2 chat-fc71869a9638dbb4a715f85680915cf1c12a1ae4.zip |
Merge branch 'master' into PLT-11-email
Diffstat (limited to 'api/file.go')
-rw-r--r-- | api/file.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/api/file.go b/api/file.go index c85d241f3..acb18a7d4 100644 --- a/api/file.go +++ b/api/file.go @@ -24,6 +24,7 @@ import ( "io" "io/ioutil" "math" + "mime" "net/http" "net/url" "os" @@ -424,7 +425,7 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "max-age=2592000, public") w.Header().Set("Content-Length", strconv.Itoa(len(f))) - w.Header().Set("Content-Type", "") // need to provide proper Content-Type in the future + w.Header().Set("Content-Type", mime.TypeByExtension(filepath.Ext(filename))) w.Write(f) } |