From 06c03762a0578ea49df58e5fdc0c4bf76175e880 Mon Sep 17 00:00:00 2001 From: hytracer Date: Wed, 22 Nov 2023 14:20:59 +0100 Subject: [PATCH] feat: add /online endpoint --- nas/route.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nas/route.go b/nas/route.go index 1a3a3bf..094c77e 100644 --- a/nas/route.go +++ b/nas/route.go @@ -73,6 +73,15 @@ func (route *Route) Handle() http.Handler { return } + // Check for /online + if strings.HasPrefix(r.URL.String(), "/online") { + logging.Notice("test") + w.Header().Set("Content-Type", "text/plain") + w.Header().Set("Content-Length", strconv.Itoa(len("Success"))) + w.Write([]byte("Success")) + return + } + err := r.ParseForm() if err != nil { logging.Error(moduleName, "Failed to parse form")