From c76f6c6609e596b6018bcbcf6673918941ed47ab Mon Sep 17 00:00:00 2001 From: Dan Enman Date: Wed, 15 May 2024 23:09:24 -0300 Subject: [PATCH] test: test for did-web parsing for id with encoded port --- crates/dids/src/methods/web/resolver.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/dids/src/methods/web/resolver.rs b/crates/dids/src/methods/web/resolver.rs index 7bbf18c6..548c3b40 100644 --- a/crates/dids/src/methods/web/resolver.rs +++ b/crates/dids/src/methods/web/resolver.rs @@ -95,5 +95,19 @@ mod tests { let did_uri = "did:web:tbd.website:with:path"; let result = Resolver::new(Identifier::parse(did_uri).unwrap()); assert_eq!(result.did_url, "https://tbd.website/with/path/did.json"); + + let did_uri = "did:web:tbd.website%3A8080"; + let result = Resolver::new(Identifier::parse(did_uri).unwrap()); + assert_eq!( + result.did_url, + "https://tbd.website:8080/.well-known/did.json" + ); + + let did_uri = "did:web:tbd.website%3A8080:with:path"; + let result = Resolver::new(Identifier::parse(did_uri).unwrap()); + assert_eq!( + result.did_url, + "https://tbd.website:8080/with/path/did.json" + ); } }