Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 70572 invoked from network); 25 Jul 2007 10:00:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 10:00:09 -0000 Received: (qmail 5224 invoked by uid 500); 25 Jul 2007 09:59:59 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 4305 invoked by uid 500); 25 Jul 2007 09:59:57 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 4294 invoked by uid 99); 25 Jul 2007 09:59:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 02:59:57 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of dan.javadev@googlemail.com designates 66.249.82.237 as permitted sender) Received: from [66.249.82.237] (HELO wx-out-0506.google.com) (66.249.82.237) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 02:59:55 -0700 Received: by wx-out-0506.google.com with SMTP id h27so121377wxd for ; Wed, 25 Jul 2007 02:59:34 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Ew7E1rwsnqxCj0zBQcxjRpydfJ1/prFMfVXmGIi12NT66yd8P1v9Tt8iNPiPv0pQKEAja6BS84FZHHsEsGxaGFjx+ovFAJIe8QL+qNLP1bSmfE7aCCydM50rBpPkg/Hpe4lwRgbHviwPRKC5PkZNJQ40h0HZHlEMTax9hTvu9q8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=pjyNpxmtyjxF1UOE2veLB8tZOk2U2sdgRJFOVjaDioUHaYTL/mAAbV/NAMHsp1T407Jq4L5M2+g5g2UlJBcabXb2/8lFFcrsYOD7o1kh58/6FwFd9NSDCWRMPZQpwggx45Ziea8oaVYVXmEhOROjDUdPqe0YkCNEzJmNzlWM1jY= Received: by 10.90.105.19 with SMTP id d19mr227476agc.1185357573988; Wed, 25 Jul 2007 02:59:33 -0700 (PDT) Received: by 10.90.81.20 with HTTP; Wed, 25 Jul 2007 02:59:33 -0700 (PDT) Message-ID: Date: Wed, 25 Jul 2007 10:59:33 +0100 From: "Daniel JavaDev" To: users@httpd.apache.org In-Reply-To: <813716b60707242221m6be3aaf5g97d6c02225b62691@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_151257_11243496.1185357573970" References: <813716b60707242221m6be3aaf5g97d6c02225b62691@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] mod_rewrite, mod_proxy and content-length ------=_Part_151257_11243496.1185357573970 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Unfortunately it's not my client, but Nokia's EAIF MMSC (emulator in this case). Like I said, I've coded my application to the protocol (EAIF) and it works. I only need to add apache httpd in between in order to restrict access to the application (by IP address range). The response headers without using apache httpd: HTTP/1.1 202 Accepted Server: Apache-Coyote/1.1 X-Powered-By: Servlet 2.4; JBoss-4 (build: CVSTag=JBoss_4)/Tomcat-5.5 Transfer-Encoding: chunked Date: Wed, 25 Jul 2007 08:39:07 GMT And the headers using apache httpd and mod_proxy: HTTP/1.1 202 Accepted Date: Wed, 25 Jul 2007 08:43:37 GMT Server: Apache-Coyote/1.1 X-Powered-By: Servlet 2.4; JBoss-4 (build: CVSTag=JBoss_4)/Tomcat-5.5 Content-Length: 0 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/plain As you can see, httpd is replacing Transfer-Encoding with C-L, which is breaking things. I've used 'SetEnv proxy-sendchunked 1' in my httpd config, but it did not make a difference. Another kind of response (204 No Content) used for synchronous ACKs has the same issue. I'm tempted to hack the mod_proxy code but only has a last resort. Surely there must be some way to configure httpd to stick with the original headers. Cheers Dan On 25/07/07, Vincent Bray wrote: > > On 25/07/07, Daniel JavaDev wrote: > > Hi all, > > > > I have the following rules on my apache 2.2.4 config: > > > > RewriteEngine on > > RewriteRule ^/someURL http://anotherURL [P] > > > > where someURL is the a publicly available url, and anotherURL is a > private > > url (localhost on another port). This setup is for restricting access to > an > > application server. > > > > It all works fine, except that the application needs to return an empty > body > > response (ACK) for some HTTP POSTs, and apache is adding the > CONTENT-LENGTH: > > 0 header to those responses, which is an invalid header in the context > of > > the protocol used by the application. > > > > Is there anyway of forcing apache not to add the content-length header > to > > the responses? > > > > Apache is a http server, not a http-but-not-really server. If your > client barfs on a correct Content-Length header then your client is > broken. I'd suggest either using 204 No Content, or designing your own > protocol. > > -- > noodl > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP Server Project. > See for more info. > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > " from the digest: users-digest-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > > ------=_Part_151257_11243496.1185357573970 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Unfortunately it's not my client, but Nokia's EAIF MMSC (emulator in this case).

Like I said, I've coded my application to the protocol (EAIF) and it works. I only need to add apache httpd in between in order to restrict access to the application (by IP address range).

The response headers without using apache httpd:
HTTP/1.1 202 Accepted
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4 (build: CVSTag=JBoss_4)/Tomcat-5.5
Transfer-Encoding: chunked
Date: Wed, 25 Jul 2007 08:39:07 GMT

And the headers using apache httpd and mod_proxy:
HTTP/1.1 202 Accepted
Date: Wed, 25 Jul 2007 08:43:37 GMT
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4 (build: CVSTag=JBoss_4)/Tomcat-5.5
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/plain

As you can see, httpd is replacing Transfer-Encoding with C-L, which is breaking things.
I've used 'SetEnv proxy-sendchunked 1' in my httpd config, but it did not make a difference.

Another kind of response (204 No Content) used for synchronous ACKs has the same issue.

I'm tempted to hack the mod_proxy code but only has a last resort. Surely there must be some way to configure httpd to stick with the original headers.

Cheers

Dan

On 25/07/07, Vincent Bray <noodlet@gmail.com> wrote:
On 25/07/07, Daniel JavaDev <dan.javadev@googlemail.com> wrote:
> Hi all,
>
> I have the following rules on my apache 2.2.4 config:
>
> RewriteEngine on
> RewriteRule ^/someURL http://anotherURL [P]
>
> where someURL is the a publicly available url, and anotherURL is a private
> url (localhost on another port). This setup is for restricting access to an
> application server.
>
> It all works fine, except that the application needs to return an empty body
> response (ACK) for some HTTP POSTs, and apache is adding the CONTENT-LENGTH:
> 0 header to those responses, which is an invalid header in the context of
> the protocol used by the application.
>
> Is there anyway of forcing apache not to add the content-length header to
> the responses?
>

Apache is a http server, not a http-but-not-really server. If your
client barfs on a correct Content-Length header then your client is
broken. I'd suggest either using 204 No Content, or designing your own
protocol.

--
noodl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


------=_Part_151257_11243496.1185357573970--