fix: cats errors
This commit is contained in:
parent
dc75b05877
commit
34c42374b5
8
app.py
8
app.py
@ -55,6 +55,8 @@ def osint():
|
|||||||
@app.route("/web/sql-injection", methods=('GET', 'POST'))
|
@app.route("/web/sql-injection", methods=('GET', 'POST'))
|
||||||
def websql():
|
def websql():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
if 'login' not in (keys := request.form.keys()) or 'pass' not in keys:
|
||||||
|
abort(400)
|
||||||
login = request.form['login']
|
login = request.form['login']
|
||||||
password = request.form['pass']
|
password = request.form['pass']
|
||||||
cursor = get_db().cursor()
|
cursor = get_db().cursor()
|
||||||
@ -198,9 +200,9 @@ def success_login():
|
|||||||
return render_template('success-sql.html', flag=flag)
|
return render_template('success-sql.html', flag=flag)
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
@app.errorhandler(werkzeug.exceptions.NotFound)
|
@app.errorhandler(werkzeug.exceptions.HTTPException)
|
||||||
def handle_bad_request(e):
|
def error_handler(e):
|
||||||
return '<img src="https://http.cat/404.jpg">', 404
|
return f'<img src="https://http.cat/{e.code}.jpg">', e.code
|
||||||
|
|
||||||
app.run(host="0.0.0.0", debug=False)
|
app.run(host="0.0.0.0", debug=False)
|
||||||
connection.close()
|
connection.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user