Compare commits
3 Commits
feature/HR
...
feature/HR
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31db3a8260 | ||
|
|
278245cd7c | ||
|
|
225295030b |
1266
dashboard_saas.html
1266
dashboard_saas.html
File diff suppressed because it is too large
Load Diff
@@ -743,19 +743,29 @@ def pod_static(filename=""):
|
|||||||
@app.route("/turf/api/")
|
@app.route("/turf/api/")
|
||||||
@app.route("/turf/api/<path:api_path>")
|
@app.route("/turf/api/<path:api_path>")
|
||||||
def api_proxy(api_path=""):
|
def api_proxy(api_path=""):
|
||||||
if api_path.startswith("vitesse"):
|
# Routes servies par combined_api.py (port 8790) :
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
# backtest, stats, paris, parisroi, races, scores, report, ask, brave-search,
|
||||||
elif api_path.startswith("n8n-proxy"):
|
# execute-sql, send-email, vitesse, n8n-proxy, predictions_analysis, ideas
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
# Fix HRT-73 : alignement complet avec turf_scraper fix #23
|
||||||
elif api_path.startswith("backtest"):
|
COMBINED_ROUTES = (
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
"backtest",
|
||||||
elif api_path.startswith("stats"):
|
"stats",
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
"parisroi",
|
||||||
elif api_path.startswith("predictions_analysis"):
|
"paris",
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
"predictions_analysis",
|
||||||
elif api_path.startswith("parisroi"):
|
"vitesse",
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
"n8n-proxy",
|
||||||
elif api_path.startswith("paris"):
|
"races",
|
||||||
|
"race/",
|
||||||
|
"scores",
|
||||||
|
"ask",
|
||||||
|
"brave-search",
|
||||||
|
"execute-sql",
|
||||||
|
"send-email",
|
||||||
|
"report",
|
||||||
|
"ideas",
|
||||||
|
)
|
||||||
|
if any(api_path.startswith(r) for r in COMBINED_ROUTES):
|
||||||
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
url = f"{COMBINED_API_URL}/turf/api/{api_path}"
|
||||||
elif api_path.startswith("scoring"):
|
elif api_path.startswith("scoring"):
|
||||||
url = f"{DASHBOARD_API_URL}/turf/api/{api_path}"
|
url = f"{DASHBOARD_API_URL}/turf/api/{api_path}"
|
||||||
@@ -770,11 +780,17 @@ def api_proxy(api_path=""):
|
|||||||
if fwd_method in ("POST", "PUT", "PATCH")
|
if fwd_method in ("POST", "PUT", "PATCH")
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
|
# Forwarder Authorization header (combined_api.py exige Basic h3r7:h3r7 pour parisroi/paris)
|
||||||
fwd_headers = {"Content-Type": "application/json"}
|
fwd_headers = {"Content-Type": "application/json"}
|
||||||
if request.headers.get("Authorization"):
|
incoming_auth = request.headers.get("Authorization")
|
||||||
fwd_headers["Authorization"] = request.headers.get("Authorization")
|
if incoming_auth:
|
||||||
|
fwd_headers["Authorization"] = incoming_auth
|
||||||
resp = requests.request(
|
resp = requests.request(
|
||||||
method=fwd_method, url=url, json=fwd_json, timeout=30, headers=fwd_headers
|
method=fwd_method,
|
||||||
|
url=url,
|
||||||
|
json=fwd_json,
|
||||||
|
timeout=30,
|
||||||
|
headers=fwd_headers,
|
||||||
)
|
)
|
||||||
return resp.content, resp.status_code, {"Content-Type": "application/json"}
|
return resp.content, resp.status_code, {"Content-Type": "application/json"}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user