Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def route(self, url, method=False):
for route in self.container.make('WebRoutes'):
matchurl = create_matchurl(url, route)
if self.container.make('Request').has_subdomain():
# Check if the subdomain matches the correct routes domain
if not route.has_required_domain():
continue
if matchurl.match(url) and method in route.method_type:
return MockRoute(route, self.container)
raise RouteNotFoundException("Could not find a route based on the url '{}'".format(url))
def route(self, url, method=False):
for route in self.container.make('WebRoutes'):
matchurl = create_matchurl(url, route)
if self.container.make('Request').has_subdomain():
# Check if the subdomain matches the correct routes domain
if not route.has_required_domain():
continue
if matchurl.match(url) and method in route.method_type:
return MockRoute(route, self.container)
raise RouteNotFoundException("Could not find a route based on the url '{}'".format(url))