w3c / did-resolution

RELEASED DRAFT: Decentralized Identifier Resolution (DID Resolution) 0.2 Specification
https://w3c.github.io/did-resolution/
Other
17 stars 9 forks source link

Prevent double fragment in service endpoint URL. #68

Closed clehner closed 2 years ago

clehner commented 3 years ago

This adds a check to ensure that an output service endpoint URL does not have two fragment components. This is equivalent to the requirement in Service Endpoint Construction that "the input DID URL and input service endpoint URL MUST NOT both have a fragment component". The reason to add it here is because when the Service Endpoint Construction algorithm is called (in Step 1.2 of Dereferencing the Primary Resource), the input DID URL has already had its fragment removed (in Step 2 of the DID URL dereferencing algorithm, so the existing check is not effectual. The removed fragment is appended to the output service endpoint URL in Dereferencing the Secondary Resource (Step 2.1), so this PR adds the check there.