Re: telnet ok, HTTP not

Jeff King <[email protected]> Tue, 19 Nov 2002 14:53:24 -0500 (EST)
Newsgroups gmane.comp.djb.publicfile
Message-ID <[email protected]>
On Tue, 19 Nov 2002, Alexandros Papadopoulos wrote:

> [root@helios /home/alex]$ ls -al /public/file/
> total 12
> drwxr-sr-x    3      4096 Nov 19 14:40 .
> drwxr-sr-x    5      4096 Nov 18 15:12 ..
> drwxr-sr-x    3      4096 Nov 19 14:18 0
> lrwxrwxrwx    1     14 Nov 18 16:16 10.6.22.1 -> /public/file/0
> lrwxrwxrwx    1     1 Nov 18 15:57 127.0.0.1 -> 0
> lrwxrwxrwx    1    14 Nov 19 14:38 128.2.66.150:55555 -> /public/file/0
> lrwxrwxrwx    1    1 Nov 18 15:50 localhost -> 0

So which Host: fields do you expect to be accepted? 10.6.22.1, 127.0.0.1,
128.2.66.150:55555, localhost, or 0, (that is, a request without a Host:
field).

> GET HTTP 1.0
> Host: 128.2.66.150
>
> HTTP/1.1 404 file does not exist

128.2.66.150 is *not* in the accepted list above. However, this is also not
identical to the request you were claiming didn't work before (that request
featured 128.2.66.150:55555).

> [root@helios /home/alex]$ telnet 128.2.66.150 55555
> Trying 128.2.66.150...
> Connected to 128.2.66.150.
> Escape character is '^]'.
> GET
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

This works because there is no Host: line, which means that publicfile looks
in the .../0 directory.

> I still don't get it. :-(

Publicfile looks in /var/public/file/${THE THING IN YOUR HOST: FIELD} for the
actual content. Simple as that.

-Peff