From a832cfdb657137ac65c329b6e8a5197b131bed70 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Wed, 5 Jan 2022 19:28:54 +0800 Subject: [PATCH] [Fixed] compatible cfw --- hub/route/script.go | 16 ++++++++++++++++ hub/route/server.go | 1 + 2 files changed, 17 insertions(+) create mode 100644 hub/route/script.go diff --git a/hub/route/script.go b/hub/route/script.go new file mode 100644 index 00000000..fc1f791d --- /dev/null +++ b/hub/route/script.go @@ -0,0 +1,16 @@ +package route + +import ( + "github.com/go-chi/chi/v5" + "net/http" +) + +func scriptRouter() http.Handler { + r := chi.NewRouter() + r.Get("/", getScript) + return r +} + +func getScript(writer http.ResponseWriter, request *http.Request) { + writer.WriteHeader(http.StatusMethodNotAllowed) +} diff --git a/hub/route/server.go b/hub/route/server.go index 402ba666..b657128e 100644 --- a/hub/route/server.go +++ b/hub/route/server.go @@ -72,6 +72,7 @@ func Start(addr string, secret string) { r.Mount("/connections", connectionRouter()) r.Mount("/providers/proxies", proxyProviderRouter()) r.Mount("/providers/rules", ruleProviderRouter()) + r.Mount("/script", scriptRouter()) }) if uiPath != "" {