Hacker News new | ask | show | jobs
by jameshart 3680 days ago
Almost.

The file: signifies the protocol. The /// is actually //<machinename>/ with an empty machinename as a shorthand for 'localhost'.

1 comments

Interesting.

Why is this interpreted as a relative path?

     cd /etc
     curl file://resolv.conf
Well, it's ill-formed, so what the UA does with it isn't really specified; cURL presumably treats it as a path relative to . because that's what the developer(s) decided that cURL should do. (For comparison, Firefox transforms it into file:///resolv.conf, then tries to find /resolv.conf on localhost and fails.)