in reply to Re^2: write a small Perl HTTP server
in thread write a small Perl HTTP server

The argument does start with a slash if your "server" is not working as a proxy, and the HTTP string comes after the space, which is also matched with the regex.

Replies are listed 'Best First'.
Re^4: write a small Perl HTTP server
by gaal (Parson) on Jul 09, 2004 at 16:43 UTC
    No, that's incorrect:

    The HTTP RFC (2616) defines the Request-Line thus (section 5.1):

    Request-Line   = Method SP Request-URI SP HTTP-Version CRLF

    And Request-URI thus:

    Request-URI    = "*" | absoluteURI | abs_path | authority

    So although you *may* supply an absolute path as an argument to GET, you may also supply a URI; in fact, you'll see that that's what virtually all clients send, because otherwise virtual hosts will be broken.
      Virtual Hosts work with a Host: field in the header. An URI is syntactically correct in this place, however the semantic is "proxy this". It's mentioned because the protocol for proxies is HTTP too.
        Ugh, you're right, I forgot about the Host: header.

        ACK the point on semantic indication, too. I stand corrected!

        In any case, the IO::All code still needs to be fixed so that it looks for the object after a single slash; and without query params; and it should discard the HTTP version string, too, if it's not doing anything with it.