4 ms·
Well 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:
by easrng 4y ago
Well 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 $