Update main.py
Browse files
main.py
CHANGED
@@ -44,7 +44,7 @@ def async_task():
|
|
44 |
return jsonify({"error": "No selected file"}), 400
|
45 |
file_content = file.read()
|
46 |
headers = dict(request.headers)
|
47 |
-
if not headers.get("KEY")
|
48 |
return jsonify({"status" : False, "msg" : "Invalid API Key"}), 404
|
49 |
print(f"QUESTION ASKED : {headers.get('QU', '')}")
|
50 |
answer = get_answer(file_content, headers.get('QU', ''))
|
|
|
44 |
return jsonify({"error": "No selected file"}), 400
|
45 |
file_content = file.read()
|
46 |
headers = dict(request.headers)
|
47 |
+
if not headers.get("KEY") != os.getenv("KEY"):
|
48 |
return jsonify({"status" : False, "msg" : "Invalid API Key"}), 404
|
49 |
print(f"QUESTION ASKED : {headers.get('QU', '')}")
|
50 |
answer = get_answer(file_content, headers.get('QU', ''))
|