mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-10-31 23:05:54 +00:00
[upload] Send 400 if POSTed at with a bad form
This commit is contained in:
parent
b2b8ae9722
commit
6990effaf7
|
@ -613,7 +613,9 @@ def upload():
|
||||||
|
|
||||||
return flask.redirect('/view/' + str(torrent.id))
|
return flask.redirect('/view/' + str(torrent.id))
|
||||||
else:
|
else:
|
||||||
return flask.render_template('upload.html', form=form, user=flask.g.user)
|
# If we get here with a POST, it means the form data was invalid: return a non-okay status
|
||||||
|
status_code = 400 if flask.request.method == 'POST' else 200
|
||||||
|
return flask.render_template('upload.html', form=form, user=flask.g.user), status_code
|
||||||
|
|
||||||
|
|
||||||
@app.route('/view/<int:torrent_id>')
|
@app.route('/view/<int:torrent_id>')
|
||||||
|
|
Loading…
Reference in a new issue