mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-28 12:16:48 +08:00
fix (#234): missing mime type
This commit is contained in:
@ -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<len(openers); i++ {
|
||||
|
||||
@ -94,7 +94,7 @@ func init(){
|
||||
|
||||
Hooks.Register.HttpEndpoint(func(r *mux.Router, app *App) error {
|
||||
r.HandleFunc(OverrideVideoSourceMapper, func(res http.ResponseWriter, req *http.Request) {
|
||||
res.Header().Set("Content-Type", "application/javascript")
|
||||
res.Header().Set("Content-Type", GetMimeType(req.URL.String()))
|
||||
res.Write([]byte(`window.overrides["video-map-sources"] = function(sources){`))
|
||||
res.Write([]byte(` return sources.map(function(source){`))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user