From f6c59288271f67410fcc80335e516e4c51fa1bb4 Mon Sep 17 00:00:00 2001 From: Benoit Moreau Date: Thu, 25 Jul 2019 01:16:38 +0200 Subject: [PATCH] replace cgi.escape by html.escape because is deprecated (#3) and change Content-Type to json --- index.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index ed8d49b..d3dece4 100644 --- a/index.py +++ b/index.py @@ -3,6 +3,7 @@ # IMPORTATION import cgi +import html import json import ssl import hashlib @@ -106,7 +107,7 @@ def headers_validation(DOMAIN): # MAIN -print("Content-Type: text/html") +print("Content-Type: application/json") print("") fs = cgi.FieldStorage() @@ -117,7 +118,7 @@ if "domain" not in fs: print("{ERROR}") cgi.sys.exit(0) -domain = cgi.escape(fs["domain"].value) +domain = html.escape(fs["domain"].value) if dnssec_validation(domain) is True: JSON_DATA["DNSSEC"] = True