I have a weird situation where I have a list of urls written by my users (sometimes with omitting https, e.g. www.google.com or google.com), I would like to redirect to those URLs but I am not sure should I append "http://" or "https://", is there an accepted way or library to convert them to proper redirect links to use in express res.redirect("url").
Let me be more clear:
Here is a working express code:
res.redirect("http://www.google.com")
and the one I have with error:
res.redirect("google.com")
which redirects me to myhost/google.com. Question is, it doesn't matter how these URLs are written, if you copy and paste them to chrome address bar, they will work. I would like the same functionality in my redirects.
I am sorry if this is just too dumb to ask, I am kind of a newby in express and node.js