somoncef commited on
Commit
3f94a62
·
1 Parent(s): 4be7257

rolling back last commit

Browse files
Files changed (1) hide show
  1. app.py +13 -13
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
- 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'])
 
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'])