lxw
2023-11-06 49f031daa9d859d15f0c5fff6af9ed2c29f91b4b
src/main/java/com/whyc/filter/LDAPFilter.java
@@ -32,7 +32,7 @@
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        Locale.setDefault(Locale.ENGLISH);
        //Locale.setDefault(Locale.ENGLISH);
        //严格要求
        if(2 == YamlProperties.systemType) {
            String requestURI = request.getRequestURI();
@@ -51,7 +51,7 @@
                        //paramValue = paramValue.replace(String.valueOf(LDAP_FILTER_ESCAPE_SEQUENCE[charIndex]), LDAP_FILTER_ESCAPE_SEQUENCE_CHARACTER[charIndex]);
                        //这个里面是允许*的,可以放过
                        if (
                                (requestURI.contains("user/") && c == '*' && (request.getMethod().toUpperCase().equals(RequestMethod.POST.name()) || request.getMethod().toUpperCase().equals(RequestMethod.PUT.name())))
                                (requestURI.contains("user/") && c == '*' && (request.getMethod().toUpperCase(Locale.ENGLISH).equals(RequestMethod.POST.name()) || request.getMethod().toUpperCase(Locale.ENGLISH).equals(RequestMethod.PUT.name())))
                        ) {
                            continue;
                        } else if ((requestURI.contains(".servlet") || requestURI.contains("menu/menuList")) && c == '/') {
@@ -79,7 +79,7 @@
                if (index != -1) {
                    //这个里面是允许*的,可以放过
                    if (
                            (requestURI.contains("user/") && c == '*' && (request.getMethod().toUpperCase().equals(RequestMethod.POST.name()) || request.getMethod().toUpperCase().equals(RequestMethod.PUT.name())))
                            (requestURI.contains("user/") && c == '*' && (request.getMethod().toUpperCase(Locale.ENGLISH).equals(RequestMethod.POST.name()) || request.getMethod().toUpperCase(Locale.ENGLISH).equals(RequestMethod.PUT.name())))
                    ) {
                        continue;