diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/constraint/ContentTypeConstraint.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/constraint/ContentTypeConstraint.java index 31d8ef7d1a..ff80a83a40 100644 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/constraint/ContentTypeConstraint.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/constraint/ContentTypeConstraint.java @@ -16,7 +16,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; public @interface ContentTypeConstraint { String key() default "contentTypeError"; - String message() default "Request content type is not supported"; + String message() default "Request content type is not supported or no Content-Type header was specified"; Class[] groups() default {}; Class[] payload() default {}; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/validator/ContentTypeValidator.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/validator/ContentTypeValidator.java index e302c8d1b9..7992c12258 100644 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/validator/ContentTypeValidator.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/validator/ContentTypeValidator.java @@ -28,11 +28,12 @@ public class ContentTypeValidator implements ConstraintValidator 0; if (requestBodyPresent) { - if (contentType == null) return false; + if (contentType == null || contentTypeHeader == null) return false; else { return SUPPORTED_CONTENT_TYPES.contains(contentType); }