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

Facebook share URL rejects URLs with underscores in domain name #13

Open
waharnum opened this issue Feb 24, 2016 · 1 comment
Open

Facebook share URL rejects URLs with underscores in domain name #13

waharnum opened this issue Feb 24, 2016 · 1 comment
Labels

Comments

@waharnum
Copy link
Owner

This issue resulted in having to remove the social media link implementation until we can figure out a way around it. FB's sharer URL validator seems to be strict and follow the distinction made in this Stack Overflow post between domain name and hostname.

Twitter's share URL is OK with them, and pasting a link to a hostname with underscores directly into FB works.

Replication:

Possible workarounds:

  • do space replacement on hyphens as well as underscores. Convert any hostnames with underscores into hyphenated ones when sharing to social media. Disadvantage: people can no longer use hyphenated words in subdomains
  • do space replacement in subdomain via a double hyphen -- as well as underscores. Convert any hostnames with underscores into double hyphentated when sharing to social media.
  • travel back in time and make the hostname spec the same as the domain name spec Judged non-viable

Option 2 is probably the least bad.

@waharnum waharnum added the bug label Feb 24, 2016
@waharnum
Copy link
Owner Author

Implemented option 2 in c459ba3

Not closing this yet because it should be refactored (one of the reasons this was tricky to debug was subdomain is a bad variable name for what it's currently used for - the subdomain with its underscore / double hyphens converted into spaces)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant