Skip to content

Commit

Permalink
ScaCap#424: added "hal+json" as compatible content type for ArrayLimi…
Browse files Browse the repository at this point in the history
…tingJsonContentModifier
  • Loading branch information
mustaphazorgati committed Nov 12, 2020
1 parent f3eadef commit 540ff96
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public abstract class JsonContentModifier implements ContentModifier {

private ObjectMapper objectMapper;
private final ObjectMapper objectMapper;

public JsonContentModifier(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
Expand All @@ -39,7 +39,7 @@ public JsonContentModifier(ObjectMapper objectMapper) {
@Override
public byte[] modifyContent(byte[] originalContent, MediaType contentType) {
if (originalContent.length > 0 && contentType != null
&& contentType.includes(APPLICATION_JSON)) {
&& (contentType.includes(APPLICATION_JSON) || contentType.includes(MediaType.valueOf("application/hal+json")))) {

This comment has been minimized.

Copy link
@jmisur

jmisur Nov 17, 2020

I think content types have "compatibleWith" kind of logic, so this should be fixable for all json like content types. There must be some spring utility providing it.

return modifyContent(originalContent);
} else {
return originalContent;
Expand Down

0 comments on commit 540ff96

Please sign in to comment.