Merge pull request #1000 from hmhealey/plt604

PLT-604 Fixed download links in Safari
Этот коммит содержится в:
Corey Hulen
2015-10-12 11:29:05 -07:00
родитель f55416d9f4 e5a019390d
Коммит 2d4d25051e

Просмотреть файл

@@ -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, "/")