Github Mirror / telegraf-plugins: fa132140




Strip trailing slashes from the API URL

Strip trailing slashes from the API URL

Otherwise the API will report that the signature's wrong (because it strips any extra slashes from the request path)

Commit fa132140.

Authored 2023-05-31T18:18:39.000+01:00 by B Tasker in project Github Mirror / telegraf-plugins

+1 lines -1 lines

Commit Signature

Changes

diff --git a/soliscloud/soliscloud.py b/soliscloud/soliscloud.py
--- a/soliscloud/soliscloud.py
+++ b/soliscloud/soliscloud.py
# @@ -436,7 +436,7 @@ def configFromEnv():
# return {
# "api_id" : int(os.getenv("API_ID", 1234)),
# "api_secret" : os.getenv("API_SECRET", "abcde"),
# - "api_url" : os.getenv("API_URL", "https://tobeconfirmed"),
# + "api_url" : os.getenv("API_URL", "https://tobeconfirmed").strip('/'),
# # Max number of requests per 5 seconds
# "api_rate_limit" : int(os.getenv("API_RATE_LIMIT", 3)),
# # This is a safety net - maximum seconds to wait if we believe we'll
#