private void blockRequestIfNecessary(final HttpServletRequest httpServletRequest) {
        if (patternToBlock != null && StringUtils.isNotBlank(httpServletRequest.getRequestURI())) {
            val servetRequest = new ServletServerHttpRequest(httpServletRequest);
            val uri = ForwardedHeaderUtils.adaptFromForwardedHeaders(servetRequest.getURI(), servetRequest.getHeaders())
                .build()
                .toUriString();
            if (!this.patternToBlock.equals(RegexUtils.MATCH_NOTHING_PATTERN)
                && this.patternToBlock.matcher(uri).find()) {
                throwException(new ServletException("The request is blocked as it matches a prohibited pattern"));
            }
        }
    }
Check that some parameters should only be in POST requests (according to the configuration).

@param method             the method of the request
@param parameterMap       all the request parameters
@param onlyPostParameters parameters that should only be in POST requests
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/filters/RequestParameterPolicyEnforcementFilter.java