Added catch-all 410 response for API v1 routes
This commit is contained in:
parent
0a2c1c18fb
commit
cf04fc36fc
1 changed files with 5 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ import logging, logging.handlers
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
from flask import Flask, send_file
|
from flask import Flask, send_file, abort
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
@ -157,6 +157,10 @@ def err_log():
|
||||||
attachment_filename="openflexure_microscope_{}.log".format(timestamp),
|
attachment_filename="openflexure_microscope_{}.log".format(timestamp),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@app.route('/api/v1/', defaults={'path': ''})
|
||||||
|
@app.route('/api/v1/<path:path>')
|
||||||
|
def api_v1_catch_all(path):
|
||||||
|
abort(410, 'API v1 is no longer in use. Please upgrade your client.')
|
||||||
|
|
||||||
# Automatically clean up microscope at exit
|
# Automatically clean up microscope at exit
|
||||||
def cleanup():
|
def cleanup():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue