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:
Will Browne
2021-04-21 15:17:23 +02:00
committed by GitHub
parent 7e2bf4f6c3
commit c37a3bebb7
4 changed files with 79 additions and 9 deletions

View File

@ -131,6 +131,9 @@ func (hs *HTTPServer) registerRoutes() {
// api renew session based on cookie
r.Get("/api/login/ping", quota("session"), routing.Wrap(hs.LoginAPIPing))
// expose plugin file system assets
r.Get("/public/plugins/:pluginId/*", hs.GetPluginAssets)
// authed api
r.Group("/api", func(apiRoute routing.RouteRegister) {
// user (signed in)