Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Set application/json content-type header

Brendan Coles54b14dea404a
diff --git a/sfwebui.py b/sfwebui.py
index 0973a56f..5dd02162 100644
--- a/sfwebui.py
+++ b/sfwebui.py
@@ -699,8 +699,12 @@ class SpiderFootWebUi:
def query(self, query):
data = None
dbh = SpiderFootDb(self.config)
+
+ cherrypy.response.headers['Content-Type'] = "application/json; charset=utf-8"
+
if not query.lower().startswith("select"):
return json.dumps(["ERROR", "Non-SELECTs are unpredictable and not recommended."])
+
try:
ret = dbh.dbh.execute(query)
data = ret.fetchall()