Skip to content

Commit 1235326

Browse files
committed
Remove trailing slashes (/) from root_path
1 parent c2aa29b commit 1235326

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

optimade/server/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ def set_implementation_version(cls, v):
146146
res.update(v)
147147
return res
148148

149+
@validator("root_path", pre=False)
150+
def remove_end_slashes(cls, value: str) -> str:
151+
"""Remove ending slashes from root_path"""
152+
if isinstance(value, str):
153+
while value.endswith("/"):
154+
value = value[:-1]
155+
return value
156+
149157
@root_validator(pre=True)
150158
def load_settings(cls, values):
151159
"""

0 commit comments

Comments
 (0)