Skip to content
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

Refactor social sharing helper #5417

Merged
merged 5 commits into from
Dec 19, 2024

Conversation

tomhughes
Copy link
Member

This implements the refactorings suggested in #5415 and also improves the testing of the generated HTML to ensure that all the buttons are generated and reference the correct URL and title.

@AntonKhorev
Copy link
Collaborator

Are you sure you escape things correctly?
image

Copy link
Contributor

@kcne kcne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works well on my side. Thank you.

@kcne
Copy link
Contributor

kcne commented Dec 18, 2024

Are you sure you escape things correctly? image

This only happens on Mastodon Share links. Must be something related to their implementation. I'm not sure if the code is opensource since i could not find the github repo. On the web site about page there is only this information:

MastodonShare is 100% private, 100% free, and 100% secure. It does not store or track anything about the visitors, usernames, instances, links or content. It does not require Mastodon API access.

If you have any questions, please ask me [email protected] or @[email protected].

@AntonKhorev
Copy link
Collaborator

AntonKhorev commented Dec 18, 2024

Looks like & gets unescaped in mastodonshare.com's redirect location.

Request headers:

GET /?text=A%26B&url=http%3A%2F%2F127.0.0.1%3A3000%2Fuser%2Ffakeuser1%2Fdiary%2F86 HTTP/1.1
Host: mastodonshare.com
...

Response headers:

HTTP/1.1 302 Found
...
Location: https://en.osm.town/share?text=A&B%0A%0Ahttp://127.0.0.1:3000/user/fakeuser1/diary/86

Then it's not related to this pull request, same happens in the already deployed version.

@gravitystorm gravitystorm merged commit f8b0463 into openstreetmap:master Dec 19, 2024
22 checks passed
@gravitystorm
Copy link
Collaborator

Thanks for the refactoring!

@tomhughes tomhughes deleted the social-share-helper branch December 19, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants