Skip to content

Commit

Permalink
Converted CachePopulationRequest into Object instead of String
Browse files Browse the repository at this point in the history
  • Loading branch information
daniyaalk committed Oct 27, 2024
1 parent a785f80 commit 830e192
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class CachePopulationRequest {

private int statusCode;

private String body;
private Object body;

// Headers are modeled as a LinkedMultiValueMap to handle the list of strings
private Map<String, List<String>> headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DownstreamResponse {

private int statusCode;

private String body;
private Object body;

// Headers are modeled as a LinkedMultiValueMap to handle the list of strings
private Map<String, List<String>> headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public ResponseEntity fetch(RequestContext requestContext) {
var downstreamResponse = DownstreamResponse.builder()
.statusCode(response.getStatusCode().value())
.headers(new LinkedMultiValueMap<>(response.getHeaders()))
.body(response.getBody() != null ? Objects.requireNonNull(response.getBody()).toString() : null)
.body(response.getBody() != null ? response.getBody() : null)
.build();

updatedRequestCacheObject = requestCacheService.storeResponse(requestContext, downstreamResponse);
Expand Down

0 comments on commit 830e192

Please sign in to comment.