fix(api): set Content-Type response header

This commit is contained in:
Guanran Wang 2024-10-26 21:45:32 +08:00
parent 4e12f0f7d4
commit 503aedbf37
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF

View file

@ -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 != "" {