-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
lib/url.py: Strengthen URL escaping. #85
Conversation
1a39756
to
94ad1ce
Compare
If anyone asked, I chose the |
I think this may also closes #51 |
Having a different URL scheme from the way the webapp does it would complicate the mapping from the URLS from logged out view to the ones in this PR. Since we are not using Jekyll anymore, I think we shouldn't add a case for it either. |
8b57ace
to
347a1fe
Compare
I see, just updated the PR again! |
c9e9a34
to
f72db9d
Compare
return ( | ||
urllib.parse.quote(topic_name, safe="~()*!.'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "~()*!.'" seems to be arbitrary. It's from this commit: f8bea8a
LGTM. @timabbott FYI |
f72db9d
to
1ca7b36
Compare
Use the same implementation of how zulip sanitizes its stream name and URL into a safe URL. Closes zulip#35
1ca7b36
to
0d03636
Compare
Merged, thanks @refeed! |
Isn't this going to break any links into existing archives that use the old encoding scheme? It certainly breaks I hope Zulip is ok with me re-downloading the entire history of https://leanprover.zulipchat.com/ with the new URL scheme! |
That is indeed a problem. The Isabelle Zulip had reported this in the past: https://chat.zulip.org/#narrow/stream/127-integrations/topic/zulip-archive.3A.20FileNotFoundError. |
Generating redirect HTML pages at all the old URLs would be a reasonable compromise; having to rebuild the json cache is only annoying once, but broken links to the archive are annoying indefinitely. |
What if there is a new topic URL that happens to collide with an old URL belonging to a different topic? Or maybe there are not going to be any collisions at all. |
Use the same implementation of how zulip sanitizes its stream name and
URL into a safe URL.
Closes #35