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 5eacf925c9..7baf6cfc42 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 @@ -7,11 +7,11 @@ import javax.validation.Payload; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Constraint(validatedBy = ContentTypeValidator.class) -@Target(FIELD) +@Target(TYPE) @Retention(RUNTIME) public @interface ContentTypeConstraint { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/CreateMeeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/CreateMeeting.java index fe027dc9c8..49a50c78d9 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/CreateMeeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/CreateMeeting.java @@ -1,12 +1,16 @@ package org.bigbluebutton.api.model.request; +import jakarta.ws.rs.core.MediaType; import org.bigbluebutton.api.model.constraint.*; import org.bigbluebutton.api.model.shared.Checksum; +import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.util.Map; +import java.util.Set; +@ContentTypeConstraint public class CreateMeeting extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -51,8 +55,8 @@ public class CreateMeeting extends RequestWithChecksum { private String recordString; private Boolean record; - public CreateMeeting(Checksum checksum) { - super(checksum); + public CreateMeeting(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); } public String getName() { @@ -138,4 +142,9 @@ public class CreateMeeting extends RequestWithChecksum { isBreakoutRoom = Boolean.parseBoolean(isBreakoutRoomString); record = Boolean.parseBoolean(recordString); } + + @Override + public Set getSupportedContentTypes() { + return Set.of(MediaType.APPLICATION_FORM_URLENCODED, MediaType.MULTIPART_FORM_DATA, MediaType.APPLICATION_XML); + } } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/EndMeeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/EndMeeting.java index 55feff00df..865dd363b0 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/EndMeeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/EndMeeting.java @@ -1,16 +1,16 @@ package org.bigbluebutton.api.model.request; -import org.bigbluebutton.api.model.constraint.MeetingExistsConstraint; -import org.bigbluebutton.api.model.constraint.MeetingIDConstraint; -import org.bigbluebutton.api.model.constraint.NotEmpty; -import org.bigbluebutton.api.model.constraint.PasswordConstraint; +import org.bigbluebutton.api.model.constraint.*; import org.bigbluebutton.api.model.shared.Checksum; import org.bigbluebutton.api.model.shared.ModeratorPassword; import org.bigbluebutton.api.model.shared.Password; +import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.Map; +import java.util.Set; +@ContentTypeConstraint public class EndMeeting extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -34,8 +34,8 @@ public class EndMeeting extends RequestWithChecksum { @Valid private Password moderatorPassword; - public EndMeeting(Checksum checksum) { - super(checksum); + public EndMeeting(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); moderatorPassword = new ModeratorPassword(); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Enter.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Enter.java index 11981e1014..065cfb1803 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Enter.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Enter.java @@ -1,11 +1,16 @@ package org.bigbluebutton.api.model.request; +import jakarta.ws.rs.core.MediaType; import org.bigbluebutton.api.model.constraint.*; import org.bigbluebutton.api.service.SessionService; + +import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotNull; import java.util.Map; +import java.util.Set; -public class Enter implements Request { +@ContentTypeConstraint +public class Enter extends RequestWithSession{ public enum Params implements RequestParameters { SESSION_TOKEN("sessionToken"); @@ -27,7 +32,8 @@ public class Enter implements Request { private SessionService sessionService; - public Enter() { + public Enter(HttpServletRequest servletRequest) { + super(servletRequest); sessionService = new SessionService(); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GetJoinUrl.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GetJoinUrl.java index 96a4120e42..8c30160b20 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GetJoinUrl.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GetJoinUrl.java @@ -2,9 +2,10 @@ package org.bigbluebutton.api.model.request; import org.bigbluebutton.api.model.constraint.UserSessionConstraint; +import javax.servlet.http.HttpServletRequest; import java.util.Map; -public class GetJoinUrl implements Request { +public class GetJoinUrl extends RequestWithSession { public enum Params implements RequestParameters { SESSION_TOKEN("sessionToken"); @@ -19,6 +20,10 @@ public class GetJoinUrl implements Request { @UserSessionConstraint private String sessionToken; + public GetJoinUrl(HttpServletRequest servletRequest) { + super(servletRequest); + } + public String getSessionToken() { return sessionToken; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GuestWait.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GuestWait.java index 2e2e3aeecc..e882d9b1a3 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GuestWait.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/GuestWait.java @@ -1,14 +1,17 @@ package org.bigbluebutton.api.model.request; +import org.bigbluebutton.api.model.constraint.ContentTypeConstraint; import org.bigbluebutton.api.model.constraint.MeetingEndedConstraint; import org.bigbluebutton.api.model.constraint.MeetingExistsConstraint; import org.bigbluebutton.api.model.constraint.UserSessionConstraint; import org.bigbluebutton.api.service.SessionService; +import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotNull; import java.util.Map; -public class GuestWait implements Request { +@ContentTypeConstraint +public class GuestWait extends RequestWithSession{ public enum Params implements RequestParameters { SESSION_TOKEN("sessionToken"); @@ -29,7 +32,8 @@ public class GuestWait implements Request { private SessionService sessionService; - public GuestWait() { + public GuestWait(HttpServletRequest servletRequest) { + super(servletRequest); sessionService = new SessionService(); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/InsertDocument.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/InsertDocument.java index 3d77fe8cbf..1b5a69a0d6 100644 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/InsertDocument.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/InsertDocument.java @@ -1,11 +1,14 @@ package org.bigbluebutton.api.model.request; +import jakarta.ws.rs.core.MediaType; import org.bigbluebutton.api.model.constraint.*; import org.bigbluebutton.api.model.shared.Checksum; +import javax.servlet.http.HttpServletRequest; import java.util.Map; +import java.util.Set; - +@ContentTypeConstraint public class InsertDocument extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -21,8 +24,8 @@ public class InsertDocument extends RequestWithChecksum { @MeetingIDConstraint private String meetingID; - public InsertDocument(Checksum checksum) { - super(checksum); + public InsertDocument(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); } public String getMeetingID() { @@ -37,4 +40,9 @@ public class InsertDocument extends RequestWithChecksum { public void populateFromParamsMap(Map params) { if(params.containsKey(Params.MEETING_ID.getValue())) setMeetingID(params.get(Params.MEETING_ID.getValue())[0]); } + + @Override + public Set getSupportedContentTypes() { + return Set.of(MediaType.APPLICATION_XML); + } } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/JoinMeeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/JoinMeeting.java index b629d9c8bb..00c80b225a 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/JoinMeeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/JoinMeeting.java @@ -5,9 +5,11 @@ import org.bigbluebutton.api.model.shared.Checksum; import org.bigbluebutton.api.model.shared.JoinPassword; import org.bigbluebutton.api.model.shared.Password; +import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.Map; +@ContentTypeConstraint public class JoinMeeting extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -57,8 +59,8 @@ public class JoinMeeting extends RequestWithChecksum { @Valid private Password joinPassword; - public JoinMeeting(Checksum checksum) { - super(checksum); + public JoinMeeting(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); joinPassword = new JoinPassword(); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/LearningDashboard.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/LearningDashboard.java index a99556b373..263e729b67 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/LearningDashboard.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/LearningDashboard.java @@ -2,10 +2,11 @@ package org.bigbluebutton.api.model.request; import org.bigbluebutton.api.model.constraint.UserSessionConstraint; +import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotNull; import java.util.Map; -public class LearningDashboard implements Request { +public class LearningDashboard extends RequestWithSession { public enum Params implements RequestParameters { SESSION_TOKEN("sessionToken"); @@ -20,6 +21,10 @@ public class LearningDashboard implements Request { @UserSessionConstraint private String sessionToken; + public LearningDashboard(HttpServletRequest servletRequest) { + super(servletRequest); + } + public String getSessionToken() { return sessionToken; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingInfo.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingInfo.java index b6f28fc1f4..c40052f7a0 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingInfo.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingInfo.java @@ -1,11 +1,14 @@ package org.bigbluebutton.api.model.request; +import org.bigbluebutton.api.model.constraint.ContentTypeConstraint; import org.bigbluebutton.api.model.constraint.MeetingExistsConstraint; import org.bigbluebutton.api.model.constraint.MeetingIDConstraint; import org.bigbluebutton.api.model.shared.Checksum; +import javax.servlet.http.HttpServletRequest; import java.util.Map; +@ContentTypeConstraint public class MeetingInfo extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -22,8 +25,8 @@ public class MeetingInfo extends RequestWithChecksum { @MeetingExistsConstraint private String meetingID; - public MeetingInfo(Checksum checksum) { - super(checksum); + public MeetingInfo(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); } public String getMeetingID() { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingRunning.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingRunning.java index 5f146cdcfb..8782714b0b 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingRunning.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/MeetingRunning.java @@ -1,10 +1,13 @@ package org.bigbluebutton.api.model.request; +import org.bigbluebutton.api.model.constraint.ContentTypeConstraint; import org.bigbluebutton.api.model.constraint.MeetingIDConstraint; import org.bigbluebutton.api.model.shared.Checksum; +import javax.servlet.http.HttpServletRequest; import java.util.Map; +@ContentTypeConstraint public class MeetingRunning extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -20,8 +23,8 @@ public class MeetingRunning extends RequestWithChecksum { @MeetingIDConstraint private String meetingID; - public MeetingRunning(Checksum checksum) { - super(checksum); + public MeetingRunning(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); } public String getMeetingID() { diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Request.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Request.java index ed90a90ecb..9e3cd5c76e 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Request.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Request.java @@ -1,9 +1,13 @@ package org.bigbluebutton.api.model.request; +import javax.servlet.http.HttpServletRequest; import java.util.Map; +import java.util.Set; public interface Request

& RequestParameters> { void populateFromParamsMap(Map params); void convertParamsFromString(); + Set getSupportedContentTypes(); + HttpServletRequest getServletRequest(); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithChecksum.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithChecksum.java index fa47bc7c0a..f86d656136 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithChecksum.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithChecksum.java @@ -1,17 +1,23 @@ package org.bigbluebutton.api.model.request; +import jakarta.ws.rs.core.MediaType; import org.bigbluebutton.api.model.shared.Checksum; +import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.Map; +import java.util.Set; public abstract class RequestWithChecksum

& RequestParameters> implements Request

{ @Valid protected Checksum checksum; - protected RequestWithChecksum(Checksum checksum) { + protected HttpServletRequest servletRequest; + + protected RequestWithChecksum(Checksum checksum, HttpServletRequest servletRequest) { this.checksum = checksum; + this.servletRequest = servletRequest; } public Checksum getChecksum() { @@ -27,4 +33,14 @@ public abstract class RequestWithChecksum

& RequestParameters> public void convertParamsFromString() { } + + @Override + public Set getSupportedContentTypes() { + return Set.of(MediaType.APPLICATION_FORM_URLENCODED, MediaType.MULTIPART_FORM_DATA); + } + + @Override + public HttpServletRequest getServletRequest() { + return servletRequest; + } } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithSession.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithSession.java new file mode 100644 index 0000000000..7dc5c6445b --- /dev/null +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/RequestWithSession.java @@ -0,0 +1,25 @@ +package org.bigbluebutton.api.model.request; + +import jakarta.ws.rs.core.MediaType; + +import javax.servlet.http.HttpServletRequest; +import java.util.Set; + +public abstract class RequestWithSession

& RequestParameters> implements Request

{ + + protected HttpServletRequest servletRequest; + + protected RequestWithSession(HttpServletRequest servletRequest) { + this.servletRequest = servletRequest; + } + + @Override + public Set getSupportedContentTypes() { + return Set.of(MediaType.APPLICATION_FORM_URLENCODED, MediaType.MULTIPART_FORM_DATA); + } + + @Override + public HttpServletRequest getServletRequest() { + return servletRequest; + } +} diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SignOut.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SignOut.java index 3a0ff66122..58e3994051 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SignOut.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SignOut.java @@ -2,10 +2,11 @@ package org.bigbluebutton.api.model.request; import org.bigbluebutton.api.model.constraint.UserSessionConstraint; +import javax.servlet.http.HttpServletRequest; import javax.validation.constraints.NotNull; import java.util.Map; -public class SignOut implements Request { +public class SignOut extends RequestWithSession { public enum Params implements RequestParameters { SESSION_TOKEN("sessionToken"); @@ -20,6 +21,10 @@ public class SignOut implements Request { @UserSessionConstraint private String sessionToken; + public SignOut(HttpServletRequest servletRequest) { + super(servletRequest); + } + public String getSessionToken() { return sessionToken; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SimpleRequest.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SimpleRequest.java index 297dbdd6d4..a7ae3be80c 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SimpleRequest.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/SimpleRequest.java @@ -1,9 +1,12 @@ package org.bigbluebutton.api.model.request; +import org.bigbluebutton.api.model.constraint.ContentTypeConstraint; import org.bigbluebutton.api.model.shared.Checksum; +import javax.servlet.http.HttpServletRequest; import java.util.Map; +@ContentTypeConstraint public class SimpleRequest extends RequestWithChecksum { public enum Params implements RequestParameters { @@ -16,8 +19,8 @@ public class SimpleRequest extends RequestWithChecksum { public String getValue() { return value; } } - public SimpleRequest(Checksum checksum) { - super(checksum); + public SimpleRequest(Checksum checksum, HttpServletRequest servletRequest) { + super(checksum, servletRequest); } @Override diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Stuns.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Stuns.java index 0050906634..423910729d 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Stuns.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/request/Stuns.java @@ -3,9 +3,11 @@ package org.bigbluebutton.api.model.request; import org.bigbluebutton.api.model.constraint.*; import org.bigbluebutton.api.service.SessionService; +import javax.servlet.http.HttpServletRequest; import java.util.Map; -public class Stuns implements Request { +@ContentTypeConstraint +public class Stuns extends RequestWithSession { public enum Params implements RequestParameters { SESSION_TOKEN("sessionToken"); @@ -26,7 +28,10 @@ public class Stuns implements Request { private SessionService sessionService; - public Stuns() { sessionService = new SessionService(); } + public Stuns(HttpServletRequest servletRequest) { + super(servletRequest); + sessionService = new SessionService(); + } public String getSessionToken() { return sessionToken; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/Checksum.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/Checksum.java index 2ceccd53ef..5ceb991c60 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/Checksum.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/Checksum.java @@ -16,13 +16,9 @@ public abstract class Checksum { protected String queryStringWithoutChecksum; - @ContentTypeConstraint - protected HttpServletRequest request; - - public Checksum(String apiCall, String checksum, HttpServletRequest request) { + public Checksum(String apiCall, String checksum) { this.apiCall = ParamsUtil.sanitizeString(apiCall); this.checksum = ParamsUtil.sanitizeString(checksum); - this.request = request; } public String getApiCall() { @@ -37,14 +33,10 @@ public abstract class Checksum { return checksum; } - public HttpServletRequest getRequest() { return request; } - public void setChecksum(String checksum) { this.checksum = checksum; } - public void setRequest(HttpServletRequest request) { this.request = request; } - public String getQueryStringWithoutChecksum() { return queryStringWithoutChecksum; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/GetChecksum.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/GetChecksum.java index c1df483052..a99df6b1cb 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/GetChecksum.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/model/shared/GetChecksum.java @@ -12,8 +12,8 @@ public class GetChecksum extends Checksum { @NotEmpty(message = "You must provide the query string") private String queryString; - public GetChecksum(String apiCall, String checksum, String queryString, HttpServletRequest request) { - super(apiCall, checksum, request); + public GetChecksum(String apiCall, String checksum, String queryString) { + super(apiCall, checksum); this.queryString = ParamsUtil.sanitizeString(queryString); removeChecksumFromQueryString(); } 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 7992c12258..6ce868be88 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 @@ -3,6 +3,7 @@ package org.bigbluebutton.api.model.validator; import jakarta.ws.rs.core.MediaType; import org.apache.commons.compress.utils.Sets; import org.bigbluebutton.api.model.constraint.ContentTypeConstraint; +import org.bigbluebutton.api.model.request.Request; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,7 +12,7 @@ import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import java.util.Set; -public class ContentTypeValidator implements ConstraintValidator { +public class ContentTypeValidator implements ConstraintValidator { private static final Logger log = LoggerFactory.getLogger(ContentTypeValidator.class); @@ -25,17 +26,18 @@ public class ContentTypeValidator implements ConstraintValidator 0; + boolean requestBodyPresent = servletRequest.getContentLength() > 0; if (requestBodyPresent) { if (contentType == null || contentTypeHeader == null) return false; else { - return SUPPORTED_CONTENT_TYPES.contains(contentType); + return request.getSupportedContentTypes().contains(contentType); } } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/service/ValidationService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/service/ValidationService.java index 070e7b6863..7882c6aaa4 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/service/ValidationService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/service/ValidationService.java @@ -119,47 +119,47 @@ public class ValidationService { switch(apiCall.requestType) { case GET: - checksum = new GetChecksum(apiCall.getName(), checksumValue, queryString, servletRequest); + checksum = new GetChecksum(apiCall.getName(), checksumValue, queryString); switch(apiCall) { case CREATE: - request = new CreateMeeting(checksum); + request = new CreateMeeting(checksum, servletRequest); break; case JOIN: - request = new JoinMeeting(checksum); + request = new JoinMeeting(checksum, servletRequest); break; case MEETING_RUNNING: - request = new MeetingRunning(checksum); + request = new MeetingRunning(checksum, servletRequest); break; case END: - request = new EndMeeting(checksum); + request = new EndMeeting(checksum, servletRequest); break; case GET_MEETING_INFO: - request = new MeetingInfo(checksum); + request = new MeetingInfo(checksum, servletRequest); break; case GET_MEETINGS: case GET_SESSIONS: - request = new SimpleRequest(checksum); + request = new SimpleRequest(checksum, servletRequest); break; case INSERT_DOCUMENT: - request = new InsertDocument(checksum); + request = new InsertDocument(checksum, servletRequest); break; case GUEST_WAIT: - request = new GuestWait(); + request = new GuestWait(servletRequest); break; case ENTER: - request = new Enter(); + request = new Enter(servletRequest); break; case STUNS: - request = new Stuns(); + request = new Stuns(servletRequest); break; case SIGN_OUT: - request = new SignOut(); + request = new SignOut(servletRequest); break; case LEARNING_DASHBOARD: - request = new LearningDashboard(); + request = new LearningDashboard(servletRequest); break; case GET_JOIN_URL: - request = new GetJoinUrl(); + request = new GetJoinUrl(servletRequest); break; } }