Skip to content

Commit 1561d04

Browse files
committed
Strip trailing slashes from loki_api_url as this breaks API calls
1 parent d082e3e commit 1561d04

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

olli/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ class _LokiConfig(EnvConfig, env_prefix="loki_"):
5656
jobs: list[str]
5757
max_logs: int | None = 5_000
5858

59+
@field_validator("api_url")
60+
@classmethod
61+
def rstrip_api_url(cls, value: str) -> str:
62+
"""Strip trailing slashes from the api_url as this breaks API calls."""
63+
return value.rstrip("/")
64+
5965

6066
LOKI_CONFIG = _LokiConfig()
6167

0 commit comments

Comments
 (0)