-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
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
Links in emails missing slash separator [was: "shaarli links to comments are broken"] #971
Comments
I'm having the same issue, even when installing from The emails I get to moderate comments are missing a slash between the domain name ( For example, for the post/identifier
Likewise, when clicking on the Delete/Activate links, after confirming the action, I am redirected to the same broken URL. I tried setting a trailing slash on the Potential SolutionI think I found the problematic code: It concatenates To fix it, we could ensure there is a separating slash between origin = local("origin")
uri = thread["uri"]
if not origin.endswith("/") and not uri.startswith("/"):
uri = "/" + uri
link = origin + uri + "#isso-%i" % item["id"] This checks whether a trailing slash exists in EDIT: It might be relevant that I'm manually setting the |
@welpo your suggestion seems valid, but we should fix the underlying issue.
We're recommending people to use a trailing slash for the config |
Both my hosts in the config file have trailing slashes already, as you can see from OP. |
Apologies. Seems rather that Could you please confirm in your database that the thread uris start with slashes? Also, @roughnecks I don't understand where that trailing |
This is what I see in the admin panel, I think that's where the numbers come from: |
While for my main domain, I see it like this: https://i.imgur.com/RzW5BKH.jpeg |
For me they do not: sqlite> SELECT * FROM threads;
1|post-name|post-name Perhaps it's only affecting setups which manually set the |
Here's mine: sqlite> SELECT * FROM threads; |
As far as I understand, it seems we need to prepend a slash to thread Underlying issue would be allowing custom |
After some further investigation, I've come to the conclusion that the issue might not necessarily lie within Isso. Instead, the problem seems to be with how I was setting the Previously, I was setting these attributes to the page's slug, which resulted in malformed URLs when Isso tried to construct moderation and notification email links. To solve this, I modified the code to use a more complete path for these attributes. Specifically, I extracted the current path of the page after stripping out the language segment and used it for This adjustment allowed Isso to form URLs correctly, showing that correct configuration on the user end can mitigate the issue. I'm not sure it would make sense to change anything at all on Isso's end. Thank you all for your time and for working on this project. |
Seeing this thread while revisiting other issues, it seems we're also being inconsistent with trailing slashes in the config, e.g. #971 disallows trailing slashes for Would be great for someone to go over this whole business and figure out something more consistent. |
Checklist
master
branch does not fix my issueWhat is not working?
First of all I'm using pip to install isso and I just upgraded it to latest version.
When posting comments to a shaarli instance, the link to the comment I receive in my email is like this:
https://links.woodpeckersnest.space41/#isso-17
Someone is adding that trailing number after the TLD and all links result broken.
How can one reproduce this issue?
Have a shaarli instance at latest release - Post a comment under a link.
The text was updated successfully, but these errors were encountered: