|
@@ -14,6 +14,7 @@ import (
|
|
|
"time"
|
|
|
|
|
|
"imuslab.com/arozos/mod/common"
|
|
|
+ "imuslab.com/arozos/mod/compatibility"
|
|
|
"imuslab.com/arozos/mod/filesystem"
|
|
|
fs "imuslab.com/arozos/mod/filesystem"
|
|
|
"imuslab.com/arozos/mod/network/gzipmiddleware"
|
|
@@ -187,7 +188,7 @@ func serverMedia(w http.ResponseWriter, r *http.Request) {
|
|
|
*/
|
|
|
|
|
|
w.Header().Set("Content-Disposition", "attachment; filename=\""+filename+"\"")
|
|
|
- w.Header().Set("Content-Type", r.Header.Get("Content-Type"))
|
|
|
+ w.Header().Set("Content-Type", compatibility.BrowserCompatibilityOverrideContentType(r.UserAgent(), filename, r.Header.Get("Content-Type")))
|
|
|
if targetFsh.RequireBuffer || !filesystem.FileExists(realFilepath) {
|
|
|
//Stream it directly from remote
|
|
|
w.Header().Set("Content-Length", strconv.Itoa(int(targetFshAbs.GetFileSize(realFilepath))))
|