From 3dff99a49f765618ac48d1f92d176f6dbc8074b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Fri, 15 Sep 2023 14:09:46 +0000 Subject: [PATCH] add ACAO headers to root endpoint --- .gitignore | 1 + pkg/server/http_server.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ca55ab4f..1be6522f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea .vscode +.devcontainer cmd/interactsh-server/interactsh-server cmd/interactsh-client/interactsh-client diff --git a/pkg/server/http_server.go b/pkg/server/http_server.go index ed2535ad..e776352c 100644 --- a/pkg/server/http_server.go +++ b/pkg/server/http_server.go @@ -69,7 +69,7 @@ func NewHTTPServer(options *Options) (*HTTPServer, error) { } } router := &http.ServeMux{} - router.Handle("/", server.logger(http.HandlerFunc(server.defaultHandler))) + router.Handle("/", server.logger(server.corsMiddleware(http.HandlerFunc(server.defaultHandler)))) router.Handle("/register", server.corsMiddleware(server.authMiddleware(http.HandlerFunc(server.registerHandler)))) router.Handle("/deregister", server.corsMiddleware(server.authMiddleware(http.HandlerFunc(server.deregisterHandler)))) router.Handle("/poll", server.corsMiddleware(server.authMiddleware(http.HandlerFunc(server.pollHandler))))