Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify resolution result Content-Type #1168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Jan 10, 2022

This adds a requirement for a DID Resolution Result HTTP response to set a Content-Type header to indicate that it is a DID Resolution Result, as specified in DID Resolution:

Setting this Content-Type header is proposed in a PR to the ION implementation: decentralized-identity/ion#244.

Without the Content-Type header, a resolver-client might expect the response to be a DID Document rather than a DID Resolution Result, as https://w3c-ccg.github.io/did-resolution/#bindings-https currently specifies that if the Accept header is not used, the HTTP response body contains the DID Document (didDocumentStream) rather than the DID Resolution Result object. Determining the response type from the response body (content sniffing) would be possible, but it may be preferable to rely on the Content-Type header. With this header set, a client can determine that they've received a DID Resolution Result object rather than a DID document, without having to parse the response body.

@@ -14,6 +14,8 @@ Sidetree defines `published`, `updateCommitment`, and `recoveryCommitment` metho
- `updateCommitment` is the commitment for the next update operation as defined in [commitment schemes](https://identity.foundation/sidetree/spec/#commitment-schemes).
- `recoveryCommitment` is the commitment for the next recover or deactivate operation as defined in [commitment schemes](https://identity.foundation/sidetree/spec/#commitment-schemes).

The DID Resolution Result response ****MUST**** contain a `Content-Type` HTTP header with value `application/ld+json;profile="https://w3id.org/did-resolution"`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering why we would set LD here, as we were hoping to use just plain JSON. The output doc should parse as either, but I think folks were inclined to use plain JSON as the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants