From 2c891c35c8853dac19fc82fac0a96e71129f1852 Mon Sep 17 00:00:00 2001 From: Mickael Kerjean Date: Thu, 5 Mar 2020 21:30:30 +1100 Subject: [PATCH] fix (#234): missing mime type --- server/main.go | 4 ++-- server/plugin/plg_video_transcoder/index.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.go b/server/main.go index 7b1e58e0..a33c2009 100644 --- a/server/main.go +++ b/server/main.go @@ -161,13 +161,13 @@ func initPluginsRoutes(r *mux.Router, a *App) { // frontoffice overrides: it is the mean by which plugin can interact with the frontoffice for _, obj := range Hooks.Get.FrontendOverrides() { r.HandleFunc(obj, func(res http.ResponseWriter, req *http.Request) { - res.WriteHeader(http.StatusOK) + res.Header().Set("Content-Type", GetMimeType(req.URL.String())) res.Write([]byte(fmt.Sprintf("/* Default '%s' */", obj))) }) } // map which file can be open with what application r.HandleFunc("/overrides/xdg-open.js", func(res http.ResponseWriter, req *http.Request) { - res.Header().Set("Content-Type", GetMimeType("xdg-open.js")) + res.Header().Set("Content-Type", GetMimeType(req.URL.String())) res.Write([]byte(`window.overrides["xdg-open"] = function(mime){`)) openers := Hooks.Get.XDGOpen() for i:=0; i