Răsfoiți Sursa

JSON not JS brainfart

divinity76 3 ani în urmă
părinte
comite
7c4e9bad7d
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      web/api/v1/upload/UploadHandler.php

+ 1 - 1
web/api/v1/upload/UploadHandler.php

@@ -1193,7 +1193,7 @@ class UploadHandler
             }
             }
             if(!headers_sent()){
             if(!headers_sent()){
                 // this is the most likely/expected path.
                 // this is the most likely/expected path.
-                header("Content-Type: text/javascript; charset=UTF-8");
+                header("Content-Type: application/json");
             } else {
             } else {
                 // html-encode json to prevent xss...
                 // html-encode json to prevent xss...
                 $json = htmlentities($json, ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML401);
                 $json = htmlentities($json, ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML401);