From 2112e73feda409a40f45e4b4e44c3d1cb23aca34 Mon Sep 17 00:00:00 2001 From: Paul Trudel <35616208+paultrudel@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:37:23 -0400 Subject: [PATCH] fix(API): Allow additional parameters in content type headers 2.6 (#20403) * Allow additional values in content type header * Ingore case when comparing content type strings * Use library for parsing content type string * Remove unused imports and catch exceptions when parsing content type --- .../model/validator/ContentTypeValidator.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 7c10477a1b..b54a069b4e 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 @@ -1,7 +1,6 @@ package org.bigbluebutton.api.model.validator; -import jakarta.ws.rs.core.MediaType; -import org.apache.commons.compress.utils.Sets; +import org.apache.http.entity.ContentType; import org.bigbluebutton.api.model.constraint.ContentTypeConstraint; import org.bigbluebutton.api.model.request.Request; import org.slf4j.Logger; @@ -10,7 +9,6 @@ import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; -import java.util.Set; public class ContentTypeValidator implements ConstraintValidator { @@ -31,7 +29,17 @@ public class ContentTypeValidator implements ConstraintValidator