"http://http://http://@http://http://?http://#http://" is a legitimate URL
twitter.com
twitter.com
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. http:// (scheme)
http: (user)
//http:// (password)
at the start?The : separates the username and password (it's not part of either).
The url-path is "/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://".
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 /)
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 $https://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffal...
:// (separator)
http (username)
: (separator)
//http:// (password)
@ (separator)
http (domain name)
: (separator)
//http: (port)
// (path)
?http:// (query string)
#http:// (fragment)
Is that it, the port looks a bit strange though ?