fix not path in did web

This commit is contained in:
Cayo Puigdefabregas 2024-06-04 17:56:34 +02:00
parent fb6e1270ee
commit d3e8580d00
1 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,9 @@ def key_to_did(public_key_bytes, url):
u = urlparse(url) u = urlparse(url)
domain = u.netloc domain = u.netloc
path = u.path.strip("/").replace("/", ":") path = u.path.strip("/").replace("/", ":")
return f"did:web:{domain}:{path}:{did}" if path:
return f"did:web:{domain}:{path}:{did}"
return f"did:web:{domain}:{did}"
return f"did:key:{did}" return f"did:key:{did}"