Open allthesignals opened 7 years ago
@mzagaja this might be something that can be handled on the backend too - there are javascript things to do, but I worry about adding more javascript libraries to handle one edge case. Do you know how we can validate this in the rails app? If so, I can move this issue over. Otherwise I'll just drop in https://code.google.com/archive/p/js-uri/.
Here's a regex that works, but I worry about unpredictability with it!
if (!s.match(/^[a-zA-Z]+:\/\//))
{
s = 'http://' + s;
}
Some of the URLs don't prefix
https
orhttp
, so the browser thinks it's a relative path.