Hacker News new | ask | show | jobs
by otherayden 378 days ago
Fixed! You can now throw urls with or without the protocol (protocol is the "http(s)://" part of the URL) and it will work!
2 comments

Thanks!
The protocol or scheme is the "http" or "https" keyword. The colon is a separator. The "//" introduces the "authority component" or host.

https://en.wikipedia.org/wiki/URL#Syntax

Whatever the user is "throwing at you" if it doesn't have these things in the front, it is not a "URL". It is not even a "protocol-relative URL".

You are technically correct, but for this use case it doesn’t matter, and everyone knows what is meant here. The parent also didn’t claim that a “url without the protocol” is itself a URL (nor, to be technically precise, a relative URI reference).