коммит произвёл
GitHub
родитель
f1c52387ae
Коммит
ac4c675a19
@@ -86,12 +86,6 @@ func (a *App) InitServer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginsRoute := a.srv.Router.PathPrefix("/plugins/{plugin_id:[A-Za-z0-9\\_\\-\\.]+}").Subrouter()
|
|
||||||
pluginsRoute.HandleFunc("", a.ServePluginRequest)
|
|
||||||
pluginsRoute.HandleFunc("/public/{public_file:.*}", a.ServePluginPublicRequest)
|
|
||||||
pluginsRoute.HandleFunc("/{anything:.*}", a.ServePluginRequest)
|
|
||||||
a.srv.Router.NotFoundHandler = http.HandlerFunc(a.Handle404)
|
|
||||||
|
|
||||||
// Scheduler must be started before cluster.
|
// Scheduler must be started before cluster.
|
||||||
a.initJobs()
|
a.initJobs()
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,13 @@ func (s *Server) RunOldAppInitialization() error {
|
|||||||
}
|
}
|
||||||
s.Router = s.RootRouter.PathPrefix(subpath).Subrouter()
|
s.Router = s.RootRouter.PathPrefix(subpath).Subrouter()
|
||||||
|
|
||||||
|
// FakeApp: remove this when we have the ServePluginRequest and ServePluginPublicRequest migrated in the server
|
||||||
|
fakeApp := New(ServerConnector(s))
|
||||||
|
pluginsRoute := s.Router.PathPrefix("/plugins/{plugin_id:[A-Za-z0-9\\_\\-\\.]+}").Subrouter()
|
||||||
|
pluginsRoute.HandleFunc("", fakeApp.ServePluginRequest)
|
||||||
|
pluginsRoute.HandleFunc("/public/{public_file:.*}", fakeApp.ServePluginPublicRequest)
|
||||||
|
pluginsRoute.HandleFunc("/{anything:.*}", fakeApp.ServePluginRequest)
|
||||||
|
|
||||||
// If configured with a subpath, redirect 404s at the root back into the subpath.
|
// If configured with a subpath, redirect 404s at the root back into the subpath.
|
||||||
if subpath != "/" {
|
if subpath != "/" {
|
||||||
s.RootRouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
s.RootRouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user