mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-07 20:15:24 +00:00
Merge 3d9f17fc569da50e1fd357ec3667a48f9c1fa8d8 into 3dd3e7559d99fcd263669e048851b9aa9ceb43c2
This commit is contained in:
commit
d3a737f873
@ -13,6 +13,7 @@ from dtos import V1RequestBase
|
||||
import flaresolverr_service
|
||||
import utils
|
||||
|
||||
env_proxy = os.environ.get('PROXY_URL', None)
|
||||
|
||||
class JSONErrorBottle(Bottle):
|
||||
"""
|
||||
@ -50,7 +51,11 @@ def controller_v1():
|
||||
"""
|
||||
Controller v1
|
||||
"""
|
||||
req = V1RequestBase(request.json)
|
||||
data = request.json or {}
|
||||
print (f'Request data: {env_proxy}')
|
||||
if (('proxy' not in data or not data.get('proxy')) and env_proxy is not None):
|
||||
data['proxy'] = {"url": env_proxy}
|
||||
req = V1RequestBase(data)
|
||||
res = flaresolverr_service.controller_v1_endpoint(req)
|
||||
if res.__error_500__:
|
||||
response.status = 500
|
||||
|
Loading…
x
Reference in New Issue
Block a user