From 4637dd6af45f787c77137a6fe95220e1747bc19d Mon Sep 17 00:00:00 2001 From: Joshua <> Date: Sun, 10 Dec 2023 17:59:25 +0100 Subject: [PATCH] Fixed rate limiting message --- provider_portal/app/api/customer_api/response.py | 1 + provider_portal/app/api/customer_api/routes.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/provider_portal/app/api/customer_api/response.py b/provider_portal/app/api/customer_api/response.py index 6f5f4d8..9c7edf2 100644 --- a/provider_portal/app/api/customer_api/response.py +++ b/provider_portal/app/api/customer_api/response.py @@ -11,6 +11,7 @@ class Response: "error_meter_customer_combination": ("Die Kombination von Meter UID und Customer UID existiert nicht.", 404), "error_no_data": ("Keine Daten im angegebenen Zeitraum vorhanden.", 404), "error_over_maximum": ("Die Anzahl der angeforderten Messpunkte überschreitet das Maximum. Bitte reduzieren Sie das Abfrageintervall oder teilen Sie die Anfrage auf.", 400), + "error_rate_limiting": ("Das Rate Limit wurde erreicht.", 400), "error_decoding": ("Das Format konnte nicht dekodiert werden.", 400), "error_authentication": ("Customer Portal konnte nicht authentifiziert werden.", 400) diff --git a/provider_portal/app/api/customer_api/routes.py b/provider_portal/app/api/customer_api/routes.py index 53c8aac..9840d57 100644 --- a/provider_portal/app/api/customer_api/routes.py +++ b/provider_portal/app/api/customer_api/routes.py @@ -34,7 +34,7 @@ def before_request(): # Check if the IP has exceeded the maximum allowed requests if len(request_tracker.get(ip_address, {})) >= 300: - res = {"message": "error_over_maximum"} + res = {"message": "error_rate_limiting"} return Response(dict=res).create_response()