Open
Description
In my code I often have site URLs like foo/bar/baz/
instead of https://example.com/foo/bar/baz
because they work equally well regardless of where the site is running. However, the logic in NavItem.get_active
does compare the scheme
and netloc
of the request and the URL of the navigation item. If the latter is empty the condition will fail because the request does carry that information.
if (
parsed_url.scheme != parsed_request.scheme
or parsed_url.netloc != parsed_request.netloc
):
return False
I propose adjusting the condition skip the equality check if the URL lacks that information:
if (
parsed_url.scheme and parsed_url.scheme != parsed_request.scheme
or parsed_url.netloc and parsed_url.netloc != parsed_request.netloc
):
return False
What is your opinion?
Metadata
Metadata
Assignees
Labels
No labels