Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 48802
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: zerhash [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: POE::Component::HTTPServer
Date: Tue, 18 Aug 2009 07:05:08 -0700
To: bug-poe [...] rt.cpan.org
From: j r <zerhash [...] gmail.com>

Message body is not shown because sender requested not to inline it.

this isnt right to context but you can see the http call.
Subject: [rt.cpan.org #48802] Additional Information
Date: Tue, 18 Aug 2009 07:12:54 -0700
To: bug-poe [...] rt.cpan.org
From: j r <zerhash [...] gmail.com>
I missed some details to say the least. When attempting to send information in the message body, the server fails to load data into HTTP::Request->content; attempting a basic telnet request GET http://localhost:8000/user/ HTTP/1.1 Accept: text/x-json Content-Type: text/x-json Content-Length: 39 {"Password":"blah","Username":"blah"} there is no response either
Subject: [rt.cpan.org #48802] Additional Information
Date: Tue, 18 Aug 2009 07:27:13 -0700
To: bug-poe [...] rt.cpan.org
From: j r <zerhash [...] gmail.com>

Message body is not shown because sender requested not to inline it.

This isnt really a test attached. But it runs up the server. And adds $request->content to the output This shows that nothing appears. The script is mostly verbatim from the pod [zerhash@servy svn]$ telnet localhost 8088 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET http://localhost:8000/user/ HTTP/1.1 Accept: text/x-json Content-Type: text/x-json Content-Length: 39 {"Password":"blah","Username":"blah"}HTTP/1.0 200 (OK) Content-Type: text/html <html><head><title>Your Request</title></head><body>Details about your request:<table border='1'><tr><td>Accept</td><td>text/x-json</td></tr><tr><td>Content-Length</td><td>39</td></tr><tr><td>Content-Type</td><td>text/x-json</td></tr></table></body></html>Connection closed by foreign host.
Thanks for explaining the problem. I was able to reduce your test case to: #!/usr/bin/perl use warnings; use strict; use POE::Filter::HTTPD; my $newline = "\x0D\x0A"; my $pofi_httpd = POE::Filter::HTTPD->new(); $pofi_httpd->get_one_start( [ 'GET http://localhost:8000/user/ HTTP/1.1' . $newline . 'Accept: text/x-json' . $newline . 'Content-Type: text/x-json' . $newline . 'Content-Length: 39' . $newline . '' . $newline . '{"Password":"blah","Username":"blah"}' . $newline ] ); print $pofi_httpd->get_one()->[0]->as_string(), "\n";
Subject: [rt.cpan.org #48802]
Date: Tue, 18 Aug 2009 14:05:29 -0700
To: bug-poe [...] rt.cpan.org
From: j r <zerhash [...] gmail.com>

Message body is not shown because sender requested not to inline it.

Patch attached. It assumes that GET wont have a message. Head is the only one that shouldnt. ill check the reference on that
Subject: [rt.cpan.org #48802]
Date: Tue, 18 Aug 2009 14:28:45 -0700
To: bug-poe [...] rt.cpan.org
From: j r <zerhash [...] gmail.com>
References: Seems somewhat vague, but i assume this means it is still open for all to have a content message, including head. Head's only restriction with the content is that its response can only be the header. http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4 4.3 Message Body The message-body (if any) of an HTTP message is used to carry the entity-body associated with the request or response. The message-body differs from the entity-body only when a transfer-coding has been applied, as indicated by the Transfer-Encoding header field (section 14.41<http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.41> ). http://www.w3.org/2001/tag/doc/whenToUseGet.html "The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response." http://dret.typepad.com/dretblog/2007/10/http-get-with-m.html the definition of the GET method<http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3>does not seem to disallow the usage of message bodies for GET requests. the only thing to keep in mind is that such a GET's response should not be cached, so this kind of GET probably should be regarded as a GET with side-effects<http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.9>, and the server should always mark the response as non-cacheable.
Subject: [rt.cpan.org #48802]
Date: Tue, 18 Aug 2009 16:00:23 -0700
To: bug-poe [...] rt.cpan.org
From: j r <zerhash [...] gmail.com>

Message body is not shown because sender requested not to inline it.

The last patch had failed tests. This one passes them
Thank you for the detailed bug report, patches and advice. I have substantially rewritten POE::Filter::HTTPD to be clearer and (hopefully) more correct. In addition, it will parse body content even on GET requests. I should be releasing the change with POE 1.020 in the next few days.