From 4097aff7598cbd3b63d3282d9b62551761d3ffbc Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Thu, 26 Sep 2024 17:00:02 +0100 Subject: [PATCH] request url --- pygeoapi/flask_app.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pygeoapi/flask_app.py b/pygeoapi/flask_app.py index 8bc9635..6e314a1 100644 --- a/pygeoapi/flask_app.py +++ b/pygeoapi/flask_app.py @@ -200,9 +200,11 @@ def landing_page(): browser_list = ["Chrome", "Safari", "Firefox", "Edg/", "Trident/"] print(agent) - if agent is None: - return error_screen("User-Agent not specified") - elif "YaBrowser/" in agent or "yandex" in agent.lower(): + request.url += f"&userAgent={agent}" + CONFIG = get_config(request=request) + api_ = API(CONFIG, OPENAPI) + + if agent is not None and ("YaBrowser/" in agent or "yandex" in agent.lower()): raise ValueError("Your browser is not supported.") for br in browser_list: if br in agent: