public function isExcludedPath($excludedPaths)
    {
        $request = new HttpRequest();
        $basePath = $request->getQuery('_url');

        if (is_null($excludedPaths)) {
            $excludedPaths = [];
        } elseif ($excludedPaths instanceof Config) {
            $excludedPaths = $excludedPaths->toArray();
        } else {
            $excludedPaths = (array)$excludedPaths;
        }

        foreach ($excludedPaths as $key => $value) {
            if (substr($basePath, 0, strlen($value)) == $value && $value != '/') {
                return true;
            }
        }

        return false;
    }