Returns if the path should be included. The request is ignored if it is a search query, a
page revision, related to users or user management, or talk pages.
424835
public boolean isAllowed(String path) {
    for (String filter : STARTS_WITH_FILTER) {
      if (path.startsWith(filter)) {
        return false;
      }
    }
    for (String filter : CONTAINS_FILTER) {
      if (path.contains(filter)) {
        return false;
      }
    }
    return true;
  }
1118974
private boolean isInSubsite(List<String> subSitePaths, String path) {

        boolean result = false;
        for (String subSite : subSitePaths) {
            if (path.startsWith(subSite)) {
                result = true;
                break;
            }
        }
        return result;
    }
239870
def include(self, path):
        
        for regex_item in self.regex_list:
            if regex_item.match(path):
                return False
        return True
814451
private boolean isIgnored(Path p) {
        final String path = toFQName(p);
        return this.ignoredFolders.stream().anyMatch(path::startsWith);
    }
41347
def include_path(self):
        
        parts = [self.include_dir(root=self.url_root)]
        parts.append("index")
        return "/".join(parts)
1320196
def resolve_request_path(requested_uri):
    
    from settings import PATH_ALIASES

    for key, val in PATH_ALIASES.items():
        if re.match(key, requested_uri):
            return re.sub(key, val, requested_uri)
    return requested_uri
1200407
private static boolean include(String host, java.nio.file.Path path) throws ServiceException {
        List<java.nio.file.Path> roots = getRootPaths(host);
        if (roots != null) {
            for (java.nio.file.Path rootPath : roots) {
                if (path.startsWith(rootPath))
                    return true;
            }
        }
        return false;
    }
473257
protected function isCurrentUrlUriExcluded()
    {
        if ($this->regex_uri_exclusions && preg_match($this->regex_uri_exclusions, $this->currentUrlUri())) {
            return true;
        } elseif ($this->built_in_regex_uri_exclusions && preg_match($this->built_in_regex_uri_exclusions, $this->currentUrlUri())) {
            return true;
        }
        return false;
    }
509345
public boolean isVisited(final URI path) {
        final URI localPath = stripFragment(path).normalize();
        return visitSet.contains(localPath);
    }
1055596
def _ensure_url_has_path(self, url):
        
        inx = url.find('://')
        if inx > 0:
            rest = url[inx + 3:]
        elif url.startswith('//'):
            rest = url[2:]
        else:
            rest = url

        if '/' in rest:
            return url

        scheme, netloc, path, query, frag = urlsplit(url)
        if not path:
            path = '/'

        url = urlunsplit((scheme, netloc, path, query, frag))
        return url
267465
def matches(self, request):
        
        return (
            partial_path_match(request.path_info, self.path) and
            request.method == self.method
        )
1058814
function(filePath) {
        var ignoredPaths;

        if (this.options.ignore) {
            ignoredPaths = new IgnoredPaths(this.options);
            return ignoredPaths.contains(filePath);
        }

        return false;
    }
890879
def get_path_from_query_string(req):
    
    if req.args.get('path') is None:
        raise exceptions.UserError('Path not found in query string')
    return req.args.get('path')
1315264
private boolean isRequestForbidden(StringBuffer path)
	{
			
		boolean requestIsForbidden = false;
			
		String matchString = path.toString();
		//PM82876 Start
		// The fileName or dirName can have .. , check and fail for ".." in path only which can allow to serve from different location.
		if(WCCustomProperties.ALLOW_DOTS_IN_NAME){

		    if (matchString.indexOf("..") > -1) {
		        if( (matchString.indexOf("/../") > -1) || (matchString.indexOf("\\..\\") > -1) || 
		                        matchString.startsWith("../") || matchString.endsWith("/..") || 
		                        matchString.startsWith("..\\")|| matchString.endsWith("\\..")) 
		        {

		            requestIsForbidden = true;
		            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
		                logger.logp(Level.FINE, CLASS_NAME, "isRequestForbidden", "bad path :" + matchString);                        
		        }
		    }

		    if ((!requestIsForbidden && (matchString.endsWith("\\") || matchString.endsWith(".") || matchString.endsWith("/")))) {
		        requestIsForbidden = true;                        
		    }

		}
		else{  //PM82876 End
		    /**
		     * Do not allow ".." to appear in a path as it allows one to serve files from anywhere within
		     * the file system.
		     * Also check to see if the path or URI ends with '/', '\', or '.' .
		     * PQ44346 - Allow files on DFS to be served.
		     */

		    if ((matchString.lastIndexOf("..") != -1 && (!matchString.startsWith("/...")))
		                    || matchString.endsWith("\\")
		                    // PK23475 use matchString instead of RequestURI because RequestURI is not decoded
		                    //      || req.getRequestURI().endsWith(".")
		                    || matchString.endsWith(".")
		                    // PK22928
		                    //      || req.getRequestURI().endsWith("/")){
		                    || matchString.endsWith("/"))
		        //PK22928
		    {
		        requestIsForbidden = true;
		    }

		}
		if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
			logger.logp(Level.FINE, CLASS_NAME,"isRequestForbidden","returning :" + requestIsForbidden + ", matchstring :" + matchString);
			
		return requestIsForbidden;
	}
311414
def _match(self, request, response):
        
        is_html = 'text/html' in response.get('Content-Type', '')
        if is_html and hasattr(response, 'rendered_content'):
            correct_path = PATH_MATCHER.match(request.path) is not None
            not_included = self.include_flag not in response.rendered_content
            return correct_path and not_included
        return False
135849
def include_route?(route)
      value = false

      unless route.blank? || route.path.spec =~ %r{/rails/info/properties|^/assets}
        # this block looks very busy, but, actually all that is really going on here is we are matching
        # parts of the current route against sitemap_filter data configured via config/routes.rb, then,
        # raising and catching exceptions based on the outcome of each evaluation.
        # the rule is all routes excluded, unless included via some type of filter criteria.

        begin

          DuckMap.logger.debug "\r\n  Route: #{route.verb_symbol} #{route.route_name.ljust(30)} #{route.controller_name} => #{route.action_name}"
          DuckMap.logger.debug route
          DuckMap.logger.debug %(#{"Path:".rjust(30)} #{route.path.spec})

          # we don't want to include routes without a name.
          if route.name.blank?
            unless self.blank_route_name?
              raise RouteNameMissing, "route name blank"
            end
          end

          if match_any?(route.action_name, route.exclude_actions) ||
              match_any?(route.controller_name, route.exclude_controllers) ||
              match_any?(route.name, route.exclude_names) ||
              match_any?(route.verb_symbol, route.exclude_verbs)

            raise DuckmapExclude, "exclude"

          end

          if match_any?(route.action_name, route.include_actions) ||
              match_any?(route.controller_name, route.include_controllers) ||
              match_any?(route.name, route.include_names) ||
              match_any?(route.verb_symbol, route.include_verbs)

            raise DuckmapInclude, "include"

          end

          if match_any?(route.action_name, self.sitemap_filters.current_filter[:exclude][:actions])
            raise ExplicitExclude, "exclude"
          end

          if match_any?(route.verb_symbol, self.sitemap_filters.current_filter[:exclude][:verbs])
            raise ExplicitExclude, "exclude"
          end

          if match_any?(route.controller_name, self.sitemap_filters.current_filter[:exclude][:controllers])
            raise ExplicitExclude, "exclude"
          end

          if match_any?(route.name, self.sitemap_filters.current_filter[:exclude][:names])
            raise ExplicitExclude, "exclude"
          end

          if match_any?(route.action_name, self.sitemap_filters.current_filter[:include][:actions])
            raise ExplicitInclude, "include"
          end

          if match_any?(route.verb_symbol, self.sitemap_filters.current_filter[:include][:verbs])
            raise ExplicitInclude, "include"
          end

          if match_any?(route.controller_name, self.sitemap_filters.current_filter[:include][:controllers])
            raise ExplicitInclude, "include"
          end

          if match_any?(route.name, self.sitemap_filters.current_filter[:include][:names])
            raise ExplicitInclude, "include"
          end

        rescue DuckmapExclude => e
          DuckMap.logger.debug %(#{"Duckmap Exclude".rjust(30)} -> #{e})

          if match_any?(route.action_name, route.include_actions) ||
              match_any?(route.controller_name, route.include_controllers) ||
              match_any?(route.name, route.include_names) ||
              match_any?(route.verb_symbol, route.include_verbs)

            DuckMap.logger.debug %(#{"Duckmap Exclude".rjust(30)} -> included again...)
            value = true
          end

        rescue DuckmapInclude => e
          DuckMap.logger.debug %(#{"Duckmap Include".rjust(30)} -> #{e})
          value = true

        rescue ExplicitExclude => e
          DuckMap.logger.debug %(#{"Explicit Exclude".rjust(30)} -> #{e})

        rescue ExplicitInclude => e
          DuckMap.logger.debug %(#{"Explicit Include".rjust(30)} -> #{e})
          value = true

        rescue RouteNameMissing => e
          DuckMap.logger.debug %(#{"Route Name Missing".rjust(30)} -> #{e})

        rescue Exception => e
          DuckMap.logger.info %(#{"Unknown Exception".rjust(30)} -> #{e})
          DuckMap.logger.info e.backtrace.join("\r\n")
        end

      end

      return value
    end
45436
def isrelpath(self):
        """"""
        return (self.scheme is None and self.authority is None and
                not self.path.startswith(self.SLASH))