private String getNormalisedPath(UrlWhitelistBean config, ApiRequest request) throws URISyntaxException {
        // normalise, for safety
        final URI normalisedUrl = new URI(request.getUrl()).normalize();

        String path = normalisedUrl.getPath();
        if (config.isRemovePathPrefix()) {
            if (path.startsWith(APIMAN_GATEWAY)) {
                path = path.substring(APIMAN_GATEWAY.length());
            }

            // remove org/API/version prefix, e.g. '/myorg/myapi/1.0'
            final String apiPrefix = String.format("/%s/%s/%s", //$NON-NLS-1$
                    request.getApiOrgId(),
                    request.getApiId(),
                    request.getApiVersion());

            path = path.substring(apiPrefix.length());
        }

        return path;
    }
Normalise the request URL before evaluating any access control rules, for safety. Returns the path
component of the normalised URL.

@param config  the policy configuration
@param request the incoming request
@return the normalised path
@throws URISyntaxException
plugins/url-whitelist-policy/src/main/java/io/apiman/plugins/urlwhitelist/UrlWhitelistPolicy.java