Hello Bryan,

this is a known bug of the internal connectors. The current implementation
(InboundWay#createEntity in the trunk) does not have enough information to
decide the right Representation to generate. Mainly, when a client send a
"connection: close" header without a "content-length" or without a
Transfer-encoding: chunked" header, it is hard to figure out if the
representation is available or not. In some cases it is easy, for example
GET requests. We can introduce a new property on the Method class, or try to
read a character which may block the server.
I've entered an issue for this bug as I don't see an existing one that
corresponds : http://restlet.tigris.org/issues/show_bug.cgi?id=1218

Best regards,
Thierry  Boileau


I have the following server resource:
>
> public class HelloResource extends ServerResource
> {
> @Get("txt")
> public String sayHello()
> {
> return "Hello";
> }
>
> @Get("html")
> public String getDocument()
> {
> StringBuilder html = new StringBuilder();
> html.append("<html>\n");
> html.append("  <body>\n");
> html.append("    <h2>Hello</h2>\n");
> html.append("   </body>\n");
> html.append("</html>\n");
> return html.toString();
> }
> }
>
> If I issue a get using curl and set the Accept header, everything works
> just fine.  I can get either the string Hello, or the html depending on the
> Accept header.  If I use the HTTP GUI client for OS X (
> http://ditchnet.org/httpclient/), I only get the Hello string even when
> the Accept header is set to text/html.  I debugged the code and found the
> problem in AnnotationInfo line 506 (Restlet 2.0.3).  When I use curl,
> requestEntity.isAvailable() returns false and when I use the HTTP GUI
> client, requestEntity.isAvailable() returns true.  When
> requestEntity.isAvailable() returns true, getRequestVariants() returns an
> empty list which causes isCompatibleRequestEntity() to return false.
>
> Would you consider this a Restlet bug, or a bug in the HTTP GUI I'm using?
>
> Bryan
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688917

Reply via email to