Skip to content

Commit

Permalink
Quality rerview / blocker issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MaKyOtOx committed Sep 19, 2022
1 parent 14779c7 commit f965a08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sonar.python.version=3
5 changes: 4 additions & 1 deletion engines/owl_dns/engine-owl_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,8 @@ def _parse_results(scan_id):
@app.route('/engines/owl_dns/getfindings/<scan_id>')
def getfindings(scan_id):
res = {"page": "getfindings", "scan_id": scan_id}
if not scan_id.isdecimal():
return jsonify({"status": "error", "reason": "scan_id must be numeric digits only"})

# check if the scan_id exists
if scan_id not in this.scans.keys():
Expand Down Expand Up @@ -1271,6 +1273,8 @@ def getfindings(scan_id):

@app.route('/engines/owl_dns/getreport/<scan_id>')
def getreport(scan_id):
if not scan_id.isdecimal():
return jsonify({"status": "error", "reason": "scan_id must be numeric digits only"})
filepath = f"{BASE_DIR}/results/owl_dns_{scan_id}.json"

if not os.path.exists(filepath):
Expand All @@ -1284,7 +1288,6 @@ def _json_serial(obj):
JSON serializer for objects not serializable by default json code
Used for datetime serialization when the results are written in file
"""

if isinstance(obj, datetime.datetime) or isinstance(obj, datetime.date):
serial = obj.isoformat()
return serial
Expand Down

0 comments on commit f965a08

Please sign in to comment.