diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-10-09 16:45:40 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-10-09 16:45:40 -0400 |
commit | e5a019390d91890bd098511f4845e27ff7bda430 (patch) | |
tree | 8312c43ef9a150ed4367bc195b06d52ef58e24b6 | |
parent | 12cd7c03d6676466f7b10b8e80b4e05edab0cf2a (diff) | |
download | chat-e5a019390d91890bd098511f4845e27ff7bda430.tar.gz chat-e5a019390d91890bd098511f4845e27ff7bda430.tar.bz2 chat-e5a019390d91890bd098511f4845e27ff7bda430.zip |
Fixed download links in Safari
-rw-r--r-- | api/file.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/file.go b/api/file.go index 9ebcd821b..429347596 100644 --- a/api/file.go +++ b/api/file.go @@ -408,11 +408,11 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Length", strconv.Itoa(len(f))) w.Header().Del("Content-Type") // Content-Type will be set automatically by the http writer - // attach extra headers to trigger a download on IE and Edge + // attach extra headers to trigger a download on IE, Edge, and Safari ua := user_agent.New(r.UserAgent()) bname, _ := ua.Browser() - if bname == "Edge" || bname == "Internet Explorer" { + if bname == "Edge" || bname == "Internet Explorer" || bname == "Safari" { // trim off anything before the final / so we just get the file's name parts := strings.Split(filename, "/") |