From 53c4ec1869bdab55105aeccc3aab32bdf2e27a55 Mon Sep 17 00:00:00 2001 From: John Costa Date: Fri, 7 Mar 2025 14:14:40 +0000 Subject: [PATCH] fix: using json response header --- backend/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/main.go b/backend/main.go index 2c62899..c80aa1d 100644 --- a/backend/main.go +++ b/backend/main.go @@ -116,7 +116,15 @@ func main() { }() r := chi.NewRouter() + r.Use(middleware.Logger) + r.Use(func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Content-Type", "application/json") + + next.ServeHTTP(w, r) + }) + }) r.Options("/*", func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Access-Control-Allow-Origin", "*")