Skip to content

Commit

Permalink
fix(create.js): Fix how service endpoints are added
Browse files Browse the repository at this point in the history
  • Loading branch information
Prash74 committed Oct 25, 2018
1 parent e882972 commit 933fb9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion create.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@ async function create(opts) {
// add service endpoints
if (Array.isArray(opts.ddo.service)) {
for (const service of opts.ddo.service) {
if (!service.id.startsWith('did:')) {
service.id = `${didUri.did}#${service.id}`
}
didDocument.addService(createService({
id: `${didUri.did}#${service.id}`,
id: service.id,
type: service.type,
serviceEndpoint: service.serviceEndpoint,
service
Expand Down

0 comments on commit 933fb9e

Please sign in to comment.