Skip to content

Commit

Permalink
Merge branch 'EWC-consortium:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
josmilan authored Nov 21, 2024
2 parents 93ee417 + e750836 commit 7a6c1e4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ class ProcessWebJWKFromKID {
guard did.hasPrefix("did:web:") else { return nil }

let didWithoutPrefix = did.replacingOccurrences(of: "did:web:", with: "")
let didParts = didWithoutPrefix.split(separator: ":")
let pathAndFragment = didWithoutPrefix.split(separator: "#").first ?? ""
let didParts = pathAndFragment.split(separator: ":")

guard didParts.count > 1 else { return nil }

let host = didParts[0]
let path = didParts[1].split(separator: "#").first ?? ""
let path = didParts.dropFirst().joined(separator: "/")
let didDocURLString = "https://\(host)/\(path)/did.json"

guard let didDocURL = URL(string: didDocURLString) else { return nil }
Expand Down

0 comments on commit 7a6c1e4

Please sign in to comment.