Skip to content

Commit

Permalink
fix: Fix handling of 'accept' content type
Browse files Browse the repository at this point in the history
  • Loading branch information
peacekeeper committed Feb 2, 2025
1 parent 05df066 commit ac72cbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public DereferenceResult dereference(String didUrlString, Map<String, Object> de

public DereferenceResult dereference(String didUrlString, Map<String, Object> dereferenceOptions, Map<String, Object> initialExecutionState) throws ResolutionException, DereferencingException {

if (log.isDebugEnabled()) log.debug("dereference(" + didUrlString + ") with options: " + dereferenceOptions);
if (log.isDebugEnabled()) log.debug("dereference(" + didUrlString + ") with options: " + dereferenceOptions);

if (didUrlString == null) throw new NullPointerException();
if (this.getUniResolver() == null) throw new ResolutionException("No resolver configured.");
Expand Down Expand Up @@ -145,7 +145,7 @@ public DereferenceResult dereference(String didUrlString, Map<String, Object> de
// resolve options = dereference options + DID parameters

Map<String, Object> resolveOptions = new HashMap<>(dereferenceOptions);
resolveOptions.put("accept", Representations.DEFAULT_MEDIA_TYPE);
if (! resolveOptions.containsKey("accept")) resolveOptions.put("accept", Representations.DEFAULT_MEDIA_TYPE);
if (didUrl.getParameters() != null) resolveOptions.putAll(didUrl.getParameters());

// resolve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public ResolveResult resolve(String didString, Map<String, Object> resolutionOpt

public ResolveResult resolve(String didString, Map<String, Object> resolutionOptions, Map<String, Object> initialExecutionState) throws ResolutionException {

if (log.isDebugEnabled()) log.debug("resolve(" + didString + ") with options: " + resolutionOptions);
if (log.isDebugEnabled()) log.debug("resolve(" + didString + ") with options: " + resolutionOptions);

if (didString == null) throw new NullPointerException();
if (this.getDrivers() == null) throw new ResolutionException("No drivers configured.");
Expand Down

0 comments on commit ac72cbd

Please sign in to comment.