kopia lustrzana https://gitlab.com/jaywink/federation
Add with_slash text utility
Ensures the given text has a slash at the end.merge-requests/132/head
rodzic
837f463848
commit
7b8f399468
|
@ -30,3 +30,9 @@ def validate_handle(handle):
|
|||
https://diaspora.github.io/diaspora_federation/federation/types.html#diaspora-id
|
||||
"""
|
||||
return re.match(r"[a-z0-9\-_.]+@[^@/]+\.[^@/]+", handle, flags=re.IGNORECASE) is not None
|
||||
|
||||
|
||||
def with_slash(url):
|
||||
if url.endswith('/'):
|
||||
return url
|
||||
return f"{url}/"
|
||||
|
|
Ładowanie…
Reference in New Issue