Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 94079 invoked from network); 4 Mar 2010 21:03:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Mar 2010 21:03:59 -0000 Received: (qmail 61282 invoked by uid 500); 4 Mar 2010 21:03:47 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 61206 invoked by uid 500); 4 Mar 2010 21:03:47 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 61142 invoked by uid 99); 4 Mar 2010 21:03:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 21:03:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 21:03:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2B538234C4C6 for ; Thu, 4 Mar 2010 21:03:27 +0000 (UTC) Message-ID: <1485999078.80171267736607176.JavaMail.jira@brutus.apache.org> Date: Thu, 4 Mar 2010 21:03:27 +0000 (UTC) From: "James Leigh (JIRA)" To: dev@hc.apache.org Subject: [jira] Issue Comment Edited: (HTTPCORE-219) HttpRequestParser Fails to Detect Requests Without a Message Body In-Reply-To: <1340277399.73051267720647388.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCORE-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841516#action_12841516 ] James Leigh edited comment on HTTPCORE-219 at 3/4/10 9:02 PM: -------------------------------------------------------------- I am talking about some _arbitrary_ _non-standard_ methods, but I am referring to the _standard_ HTTP messaging (not its methods). The problem I encountered is that if HttpEntityEnclodingRequest is used and there is no message-body (i.e. no Content-Length or Transfer-Encoding headers), the method NHttpRequestHandler#entityRequest is called, but the methods ConsumingNHttpEntity#consumeContent and NHttpRequestHandler#handle are never called because there is no message-body to read. This is unexpected behaviour (to me) and was not easily tracked down. Since httpCore detects the message-body differently then the HTTP spec I thought I would post this bug report so that others might not encounter this problem in the future. The solution I did implement is to override DefaultServerIOEventDispatch, DefaultNHttpServerConnection, and HttpRequestParser to replace the HttpEntityEnclosingRequest object if there is no message-body. was (Author: jleigh): I am talking about some _arbitrary_ _non-standard_ methods, but I am referring to the _standard_ HTTP messaging (not its methods). The problem I encountered is that if HttpEntityEnclodingRequest is used and there is no message-body (i.e. no Content-Length or Transfer-Encoding headers), the method NHttpRequestHandler#entityRequest is called, but the methods ConsumingNHttpEntity#consumeContent and NHttpRequestHandler#handle are never called because there is no message-body to read. This is unexpected behaviour (to me) and was not easily tracked down. Since httpCore detects the message-body differently then the HTTP spec I thought I would post this bug report so that others might not encounter this problem in the future. > HttpRequestParser Fails to Detect Requests Without a Message Body > ----------------------------------------------------------------- > > Key: HTTPCORE-219 > URL: https://issues.apache.org/jira/browse/HTTPCORE-219 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO > Affects Versions: 4.0.1 > Reporter: James Leigh > > The HttpRequestParser uses the request method to determine if the request has a message body. However, HTTP 1.1 states that the presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's header fields. The parser should be changed to use the header to determine if a message body is present. > As is a POST or PUT request is received without a message body cannot be processed. Furthermore, a GET request with a message body cannot be processed either. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org