diff --git a/backend/logs.go b/backend/logs.go index 055a8b7..256303e 100644 --- a/backend/logs.go +++ b/backend/logs.go @@ -80,8 +80,6 @@ func createLogHandler(logWriter *DatabaseWriter) func(r chi.Router) { return } - w.Header().Add("Content-Type", "text/html") - html := "" imageTag := fmt.Sprintf(``, stringImageId) diff --git a/backend/main.go b/backend/main.go index 89d1c62..037bc29 100644 --- a/backend/main.go +++ b/backend/main.go @@ -58,14 +58,6 @@ func main() { r.Use(middleware.Logger) r.Use(CorsMiddleware) - 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.WriteHeader(http.StatusOK) }) @@ -108,6 +100,13 @@ func main() { r.Group(func(r chi.Router) { r.Use(ProtectedRoute) + 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.Get("/image", func(w http.ResponseWriter, r *http.Request) { userId := r.Context().Value(USER_ID).(uuid.UUID)