Skip to content

Commit

Permalink
Merge pull request #100 from docknetwork/fix-uniresolver-urlencode-bug
Browse files Browse the repository at this point in the history
Ensure to url encode dids sent to universal resolver
  • Loading branch information
cykoder authored May 12, 2020
2 parents fc7ccf3 + 77a89e0 commit 240155d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/universal-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default class UniversalResolver extends DIDResolver {
*/
async resolve(did) {
try {
const resp = await axios.get(`${this.idUrl}${did}`);
const encodedDid = encodeURIComponent(did);
const resp = await axios.get(`${this.idUrl}${encodedDid}`);
return resp.data.didDocument;
} catch (error) {
if (error.isAxiosError && error.response.data.match(/DID not found/g)) {
Expand Down

0 comments on commit 240155d

Please sign in to comment.