From d3e8580d000699b4d362e426deb33a9d3f4748b5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 4 Jun 2024 17:56:34 +0200 Subject: [PATCH] fix not path in did web --- pyvckit/did.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyvckit/did.py b/pyvckit/did.py index fa3c507..a391d53 100644 --- a/pyvckit/did.py +++ b/pyvckit/did.py @@ -26,7 +26,9 @@ def key_to_did(public_key_bytes, url): u = urlparse(url) domain = u.netloc 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}"