Plugins: Serve static assets directly instead of through middleware handler (#32779)
* removed static routes from macaron * move path src to plugins pkg * use plugin details * remove dead code * fixes * use clean from std lib * reformat imports * remove caching headers + add security checks * revert using no cache header middleware * add cache-control headers * add 404 check * use new var for subsequent file handling
This commit is contained in:
@@ -329,12 +329,6 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {
|
||||
|
||||
m.Use(middleware.Recovery(hs.Cfg))
|
||||
|
||||
for _, route := range hs.PluginManager.StaticRoutes() {
|
||||
pluginRoute := path.Join("/public/plugins/", route.PluginId)
|
||||
hs.log.Debug("Plugins: Adding route", "route", pluginRoute, "dir", route.Directory)
|
||||
hs.mapStatic(m, route.Directory, "", pluginRoute)
|
||||
}
|
||||
|
||||
hs.mapStatic(m, hs.Cfg.StaticRootPath, "build", "public/build")
|
||||
hs.mapStatic(m, hs.Cfg.StaticRootPath, "", "public")
|
||||
hs.mapStatic(m, hs.Cfg.StaticRootPath, "robots.txt", "robots.txt")
|
||||
|
||||
Reference in New Issue
Block a user