Spaces:
Running
Running
fea:Adding API key filtering on Predict endpoint
Browse files
app.py
CHANGED
|
@@ -269,9 +269,9 @@ with app.app_context():
|
|
| 269 |
# def check_rapidapi_key():
|
| 270 |
# """Verify RapidAPI key for security"""
|
| 271 |
# if request.path == '/predict':
|
| 272 |
-
# rapidapi_key = request.headers.get('
|
| 273 |
# if not rapidapi_key:
|
| 274 |
-
# return jsonify({'error': 'Missing
|
| 275 |
|
| 276 |
@app.route('/predict', methods=['POST'])
|
| 277 |
def predict():
|
|
|
|
| 269 |
# def check_rapidapi_key():
|
| 270 |
# """Verify RapidAPI key for security"""
|
| 271 |
# if request.path == '/predict':
|
| 272 |
+
# rapidapi_key = request.headers.get('x-rapidapi-key')
|
| 273 |
# if not rapidapi_key:
|
| 274 |
+
# return jsonify({'error': 'Missing x-rapidapi-key header'}), 401
|
| 275 |
|
| 276 |
@app.route('/predict', methods=['POST'])
|
| 277 |
def predict():
|