Subject: | IO::Lambda::HTTP: no way to specify relative url |
Hi Dmitry
As I understand IO::Lambda::HTTP there is no way to perform request
using relative url.
For example to get google.com the request will be:
GET http://google.com/ HTTP/1.1
Host: google.com
User-Agent: perl/IO-Lambda-HTTP v1.21
But most software uses relative url and request looks like:
GET / HTTP/1.1
Host: google.com
User-Agent: perl/IO-Lambda-HTTP v1.21
As I understand HTTP/1.1 specification clients should use absolute url
only in requests to proxies. However in same sentence: "all HTTP/1.1
servers MUST accept the absoluteURI form in requests"
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2).
But this is theory. Here is some practice:
----------------------
$ nc www.perl.org 80
GET http://www.perl.org/ HTTP/1.1
Host: www.perl.org
HTTP/1.1 500 Internal Server Error
----------------------
$ nc www.perl.org 80
GET / HTTP/1.1
Host: www.perl.org
HTTP/1.1 200 OK
----------------------
As you can see some servers can't understand absolute url.
I think we should have some workaround for this issue.