We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build_url
Found this while browsing through the source. Havent tested whether this is actually an issue, but:
lektor/lektor/utils.py
Lines 666 to 668 in dbae91e
shouldn't that actually be
last = url.split("/")[-1] # or: # if "." in url.split("/")[-1]:
Otherwise, an URL like this /path.my/page/2/ may wrongly remove the trailing slash.
/path.my/page/2/
The text was updated successfully, but these errors were encountered:
I think you're right about the split.
split
It was probably meant to be
_, last = url.rsplit("/", 1)
Personally, I'd write it:
_, _, last = url.rpartition("/")
(Perhaps a larger refactor/cleanup is possible. Maybe using pathlib.PurePosixPath?)
pathlib.PurePosixPath
As you say, it would be nice to have an actual test/demo of how it can go wrong.
Sorry, something went wrong.
No branches or pull requests
Found this while browsing through the source. Havent tested whether this is actually an issue, but:
lektor/lektor/utils.py
Lines 666 to 668 in dbae91e
shouldn't that actually be
Otherwise, an URL like this
/path.my/page/2/
may wrongly remove the trailing slash.The text was updated successfully, but these errors were encountered: