Skip to content

Commit

Permalink
Bugfix for strict headers
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Nov 6, 2024
1 parent e813646 commit 4bc511b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/generiek/api/EnrollmentEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public EnrollmentEndpoint(@Value("${oidc.acr-context-class-ref}") String acr,
this.restTemplate = new RestTemplate(requestFactory);
this.restTemplate.getInterceptors().add((request, body, execution) -> {
request.getHeaders().add("Accept-Language", LanguageFilter.language.get());
//Bugfix for too strict DefaultBearerTokenResolver which does not ignore CHARSET
List<String> contentType = request.getHeaders().get("Content-Type");
if (!CollectionUtils.isEmpty(contentType) && contentType.getFirst().startsWith("application/x-www-form-urlencoded")) {
request.getHeaders().set("Content-Type", "application/x-www-form-urlencoded");
}
return execution.execute(request, body);
});
this.restTemplate.getInterceptors().add(new RestTemplateLoggingInterceptor());
Expand Down

0 comments on commit 4bc511b

Please sign in to comment.