INNER CODE UNIT · Python
setup
yashab-cyber/HackGpt · workbench/server.py:314
def setup(self):
super().setup()
self.connection.settimeout(10)
def log_message(self, *_):
pass
def reply(
self, status, value, kind="application/json; charset=utf-8", attachment=None
):
body = value if isinstance(value, bytes) else json.dumps(value).encode()
self.send_response(status)
self.send_header("Content-Type", kind)
self.send_header("Content-Length", str(len(body)))
self.send_header("Cache-Control", "no-store")
self.send_header("X-Content-Type-Options", "nosniff")
self.send_header("X-Frame-Options", "DENY")
self.send_header("Referrer-Policy", "no-referrer")