Skip to content

Commit

Permalink
Merge pull request #525 from tw-mosip/injiweb-1106-car-theme-changes
Browse files Browse the repository at this point in the history
[INJIWEB-1106] : add charset header for downlaod vc
  • Loading branch information
vijay151096 authored Nov 28, 2024
2 parents ae5b3f6 + b1a2548 commit ca63022
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.springframework.util.AntPathMatcher;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.PathMatcher;
import org.springframework.http.HttpMethod;
import org.springframework.web.client.RestTemplate;

import java.net.URL;

Expand Down Expand Up @@ -99,7 +101,13 @@ public VCCredentialResponse downloadCredentialFromDataShare(PresentationRequest
ErrorConstants.RESOURCE_INVALID.getErrorCode(),
ErrorConstants.RESOURCE_INVALID.getErrorMessage());
}
String vcCredentialResponseString = restApiClient.getApi(credentialsResourceUri, String.class);
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", "application/json");
headers.add("Accept-Charset", "UTF-8");

HttpEntity<String> entity = new HttpEntity<>(headers);
String vcCredentialResponseString = restTemplate.exchange(credentialsResourceUri, HttpMethod.GET, entity, String.class).getBody();
if (vcCredentialResponseString == null) {
throw new InvalidCredentialResourceException(
ErrorConstants.SERVER_UNAVAILABLE.getErrorCode(),
Expand Down

0 comments on commit ca63022

Please sign in to comment.