Automatic Merge
Этот коммит содержится в:
Jesús Espino
2020-06-12 22:26:35 +02:00
коммит произвёл GitHub
родитель f1c52387ae
Коммит ac4c675a19
2 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@@ -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.
a.initJobs()

Просмотреть файл

@@ -139,6 +139,13 @@ func (s *Server) RunOldAppInitialization() error {
}
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 subpath != "/" {
s.RootRouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {