public static boolean isPathAllowed()

in src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java [808:840]


    public static boolean isPathAllowed(final String path, final String[] executionPaths) {
        if (executionPaths == null || executionPaths.length == 0) {
            LOGGER.debug("Accepting servlet at '{}' as there are no configured execution paths.", path);
            return true;
        }

        if (path == null || path.length() == 0) {
            LOGGER.debug("Ignoring servlet with empty path.");
            return false;
        }

        for (final String config : executionPaths) {
            if (config.endsWith("/")) {
                if (path.startsWith(config)) {
                    LOGGER.debug(
                            "Accepting servlet at '{}' as the path is prefixed with configured execution path '{}'.",
                            path,
                            config);
                    return true;
                }
            } else if (path.equals(config)) {
                LOGGER.debug(
                        "Accepting servlet at '{}' as the path equals configured execution path '{}'.", path, config);
                return true;
            }
        }

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Ignoring servlet at '{}' as the path is not in the configured execution paths.", path);
        }

        return false;
    }