From ac3737fd3d11540b10e4d2dbe0db8c3e4d686923 Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Tue, 5 Dec 2023 21:46:49 -0500 Subject: [PATCH] Address request to specify did+json DID Resolution Result Signed-off-by: Frank Hinek --- packages/dids/src/did-dht.ts | 8 ++++---- packages/dids/tests/did-dht.spec.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/dids/src/did-dht.ts b/packages/dids/src/did-dht.ts index 3d6ad7aef..06a5a7489 100644 --- a/packages/dids/src/did-dht.ts +++ b/packages/dids/src/did-dht.ts @@ -258,7 +258,7 @@ export class DidDhtMethod implements DidMethod { didDocument : null, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', error : 'invalidDid', errorMessage : `Cannot parse DID: ${didUrl}` } @@ -271,7 +271,7 @@ export class DidDhtMethod implements DidMethod { didDocument : null, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', error : 'methodNotSupported', errorMessage : `Method not supported: ${parsedDid.method}` } @@ -294,7 +294,7 @@ export class DidDhtMethod implements DidMethod { didDocument : null, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', error : 'internalError', errorMessage : `An unexpected error occurred while resolving DID: ${parsedDid.did}` } @@ -306,7 +306,7 @@ export class DidDhtMethod implements DidMethod { didDocument, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', did : { didString : parsedDid.did, methodSpecificId : parsedDid.id, diff --git a/packages/dids/tests/did-dht.spec.ts b/packages/dids/tests/did-dht.spec.ts index 507ae4e1f..e0fb1e3a1 100644 --- a/packages/dids/tests/did-dht.spec.ts +++ b/packages/dids/tests/did-dht.spec.ts @@ -271,7 +271,7 @@ describe('DidDhtMethod', () => { didDocument : document, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', did : { didString : document.id, methodSpecificId : parseDid({ didUrl: document.id }).id, @@ -325,7 +325,7 @@ describe('DidDhtMethod', () => { didDocument : document, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', did : { didString : 'did:dht:123456789abcdefgh', methodSpecificId : '123456789abcdefgh', @@ -423,7 +423,7 @@ describe('DidDhtMethod', () => { didDocument, didDocumentMetadata : {}, didResolutionMetadata : { - contentType : 'application/did+ld+json', + contentType : 'application/did+json', did : { didString : 'did:dht:h4d3ixkwt6q5a455tucw7j14jmqyghdtbr6cpiz6on5oxj5bpr3o', methodSpecificId : 'h4d3ixkwt6q5a455tucw7j14jmqyghdtbr6cpiz6on5oxj5bpr3o',