diff --git a/optimade/server/config.py b/optimade/server/config.py index 7ed0f4f71..c5c5be7e7 100644 --- a/optimade/server/config.py +++ b/optimade/server/config.py @@ -146,6 +146,14 @@ def set_implementation_version(cls, v): res.update(v) return res + @validator("root_path", pre=False) + def remove_end_slashes(cls, value: str) -> str: + """Remove ending slashes from root_path""" + if isinstance(value, str): + while value.endswith("/"): + value = value[:-1] + return value + @root_validator(pre=True) def load_settings(cls, values): """