Skip to content

Commit

Permalink
Try to solve UTF-8 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
euskalhenriko committed Feb 7, 2024
1 parent 38393fc commit 33fb92e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.integratedmodelling.klab.Configuration;
import org.integratedmodelling.klab.Klab;
import org.integratedmodelling.klab.Logging;
Expand Down Expand Up @@ -123,11 +125,12 @@ public ResourceReference contextualizeResource(@RequestBody ResourceContextualiz
*/
@PostMapping(value = API.NODE.RESOURCE.GET_DATA, consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public KlabData getUrnData(@RequestBody ResourceDataRequest request, Principal principal) {
public KlabData getUrnData(@RequestBody ResourceDataRequest request, Principal principal, HttpServletResponse response) {
IGeometry geometry = Geometry.create(request.getGeometry());
if (!resourceManager.canAccess(request.getUrn(), (EngineAuthorization) principal)) {
throw new SecurityException(request.getUrn());
}
response.setCharacterEncoding("UTF-8");
// TODO also check that the principal can access the adapter

/*
Expand Down

0 comments on commit 33fb92e

Please sign in to comment.