Removed support for application/json content

This commit is contained in:
Paul 2024-03-13 14:45:00 +00:00 committed by Anton Georgiev
parent 183983be7f
commit 8e40d91877
2 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,6 @@ public class ContentTypeValidator implements ConstraintValidator<ContentTypeCons
private static final Set<String> SUPPORTED_CONTENT_TYPES = Sets.newHashSet( private static final Set<String> SUPPORTED_CONTENT_TYPES = Sets.newHashSet(
MediaType.APPLICATION_XML, MediaType.APPLICATION_XML,
MediaType.APPLICATION_JSON,
MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_FORM_URLENCODED,
MediaType.MULTIPART_FORM_DATA MediaType.MULTIPART_FORM_DATA
); );

View File

@ -29,6 +29,7 @@ public class GetChecksumValidator implements ConstraintValidator<GetChecksumCons
boolean requestBodyPresent = request.getContentLength() > 0; boolean requestBodyPresent = request.getContentLength() > 0;
String contentType = request.getContentType(); String contentType = request.getContentType();
log.info("Request content type: {}", contentType);
if (contentType != null) { if (contentType != null) {
if (contentType.equalsIgnoreCase(MediaType.APPLICATION_FORM_URLENCODED) || contentType.equalsIgnoreCase(MediaType.MULTIPART_FORM_DATA)) { if (contentType.equalsIgnoreCase(MediaType.APPLICATION_FORM_URLENCODED) || contentType.equalsIgnoreCase(MediaType.MULTIPART_FORM_DATA)) {
if (queryStringPresent && requestBodyPresent) return false; if (queryStringPresent && requestBodyPresent) return false;