@mathias I feel like you'd know the answer to this: how would I escape http://xn--b-rfa.comàb.com to valid URL characters in JS, given a user might enter that domain? (or even an emoji etc)
-
-
I'm assuming the user input is only a hostname here; Twitter's auto-linking + UI makes it unclear what you meant exactly. If it's instead a full URL, normalize it using const normalizedUrl = new URL(url).toString();
-
In the end I was able to solve (very late last night). String is encoded first at the client, sent to the server, needed custom decodeURIComponent then node's url.parse(…).href did the trick. Super inception'y though!
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.