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

Set DID Resolution Result media type #244

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

Conversation

clehner
Copy link

@clehner clehner commented Jan 6, 2022

Set the Content-Type header of the DID Resolution Result HTTP response to use the media type with profile parameter specified for a DID Resolution Result in DID Resolution: application/ld+json;profile="https://w3id.org/did-resolution".

Setting this Content-Type header helps DID resolver HTTP clients detect that the response is a DID Resolution Result - rather than e.g. a DID document alone, which is also allowed by DID Resolution's HTTP(S) Binding.

koaResponse.body = '';
} else {
koaResponse.set('Content-Type', 'application/ld+json;profile="https://w3id.org/did-resolution";charset=utf-8');
// Stringify the result as otherwise the Content-Type gets overridden to
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if you reverse line 78 and 81? If works, it would be nicer to refactor setKoaResponse() to take in optional headers to set.

Copy link
Collaborator

@thehenrytsai thehenrytsai left a comment

Choose a reason for hiding this comment

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

Commented.

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.

3 participants