Spaces:
Running
Running
rolling back last commit
Browse files
app.py
CHANGED
|
@@ -265,20 +265,20 @@ def warm_up_models():
|
|
| 265 |
with app.app_context():
|
| 266 |
warm_up_models()
|
| 267 |
|
| 268 |
-
@app.before_request
|
| 269 |
-
def check_rapidapi_key():
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
|
| 283 |
|
| 284 |
@app.route('/predict', methods=['POST'])
|
|
|
|
| 265 |
with app.app_context():
|
| 266 |
warm_up_models()
|
| 267 |
|
| 268 |
+
# @app.before_request
|
| 269 |
+
# def check_rapidapi_key():
|
| 270 |
+
# if request.path.startswith('/predict'):
|
| 271 |
+
# rapidapi_key = (
|
| 272 |
+
# request.headers.get('X-RapidAPI-Key')
|
| 273 |
+
# or request.headers.get('x-rapidapi-key')
|
| 274 |
+
# or request.environ.get('HTTP_X_RAPIDAPI_KEY')
|
| 275 |
+
# )
|
| 276 |
|
| 277 |
+
# if not rapidapi_key:
|
| 278 |
+
# return jsonify({
|
| 279 |
+
# 'error': 'Missing X-RapidAPI-Key header',
|
| 280 |
+
# 'received_headers': dict(request.headers)
|
| 281 |
+
# }), 401
|
| 282 |
|
| 283 |
|
| 284 |
@app.route('/predict', methods=['POST'])
|