From 503aedbf372c661911adeb160012306f7babcdc8 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 26 Oct 2024 21:45:32 +0800 Subject: [PATCH] fix(api): set Content-Type response header --- api/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/main.go b/api/main.go index 6311d20..0aa8744 100644 --- a/api/main.go +++ b/api/main.go @@ -129,6 +129,7 @@ func generateJSON(ip string) (body, error) { func handleRequest(w http.ResponseWriter, r *http.Request) { w.Header().Add("Access-Control-Allow-Origin", "*") + w.Header().Add("Content-Type", "application/json") sourceIP := func() string { if q := r.URL.Query().Get("q"); q != "" {