5 ms·
This mostly makes sense except the 3rd and 5th `http:// http://`, unless those are supposed to be grouped together? http:// (scheme) http:// (user)
by 4oo4 4y ago
This mostly makes sense except the 3rd and 5th `http:// http://`, unless those are supposed to be grouped together?
http:// (scheme)
http:// (user)
http:// ??
@http:// (hostname)
http:// ??
?http:// (parameter)
#http:// (fragment)
Will buy a beer for the first person that demonstrates how to serve that URL.
- joegibbs 4y agoIs it http:// (scheme) http: (user) //http:// (password) at the start?
- 22c 4y agoYes, the username is "http" the password is "//http:// http://" The : separates the username and password (it's not part of either). The url-path is "/http://?http://#http:// http://?http://#http://" which can be further broken down into /abs_path, ?query and #fragment. Edit: Also further correction to gp is that the hostname is "http" not "@http:// http://". The @ is the separator between username:password@hostname the : separates the port, which is omitted, and defaults to 80 for a http URI scheme and the first / separates the host:port portion from the path (which, in this case, happens to start with a /)
- dmkii 4y agoAll you have to do is start a new country called Http, convince ICANN to adopt it as a new TLD (will need a lot of persuasion) and serve “http” as a dotless domain. But, you know, anything for a beer… (fyi: the host name is the part after @ and before the port number indicated by “:”)
- easrng 4y agoWell first let's parse it. Welcome to Node.js v17.7.2. Type ".help" for more information. > u=new URL("http://http://http://@http://http://?http://#http://") URL { href: 'http://http//http://@http://http://?http://#http://', origin: 'http://http', protocol: 'http:', username: '', password: '', host: 'http', hostname: 'http', port: '', pathname: '//http://@http://http://', search: '?http://', searchParams: URLSearchParams { 'http://' => '' }, hash: '#http://' } Browsers give the same result, with uglier formatting. As for serving a request: ~/a $ python3 -m http.server 80 & [1] 31173 ~/a $ Serving HTTP on :: port 80 (http://[::]:80/) ... ~/a $ curl --resolve http:80:127.0.0.1 "http://http://http://@http://http://?http://#http://" ::ffff:127.0.0.1 - - [07/Sep/2022 02:15:53] code 404, message File not found ::ffff:127.0.0.1 - - [07/Sep/2022 02:15:53] "GET //http://@http://http://?http:// HTTP/1.1" 404 - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <!-- snip --> </html> ~/a $