Commit cf04fc36 authored by Joel Collins's avatar Joel Collins
Browse files

Added catch-all 410 response for API v1 routes

parent 0a2c1c18
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import logging, logging.handlers
import os
import pkg_resources

from flask import Flask, send_file
from flask import Flask, send_file, abort

from datetime import datetime

@@ -157,6 +157,10 @@ def err_log():
        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
def cleanup():