You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter Janovsky <pe...@yahoo.com> on 2010/08/17 21:51:58 UTC

[users@httpd] modifying original request response headers when using subrequests

i'm in need of help clarifying the request and subrequest life-cycles and how 
and when response headers are modified.

what i have is a request for audio content.  the audio content is verified 
within a C module which performs a subrequest.  custom response headers need to 
be sent upon a successful subrequest call.

what happens

1.  if i modify the response headers before the subrequest is performed they 
appear correct within the response
2.  if i modify the response headers after the subrequest is performed they DO 
NOT appear correct within the response

i'm using "chunked  transfer-encoding" which in conjunction with my results from 
the "what happens" section is leading me to assume that the headers are sent to 
the client before the subrequest is performed.

where can i modify the response headers after the subrequest is performed and 
before the headers are sent?


      

Re: [users@httpd] modifying original request response headers when using subrequests

Posted by Peter Janovsky <pe...@yahoo.com>.
nick, thnx for the pointers.  i'll take a look at the responsehandler to see if 
i can modify the headers.

also, thnx for the heads up on the module_dev list.



________________________________
From: Nick Kew <ni...@webthing.com>
To: users@httpd.apache.org
Sent: Tue, August 17, 2010 5:05:11 PM
Subject: Re: [users@httpd] modifying original request response headers when 
using subrequests

On Tue, 17 Aug 2010 12:51:58 -0700 (PDT)
Peter Janovsky <pe...@yahoo.com> wrote:

> 1.  if i modify the response headers before the subrequest is performed they 
> appear correct within the response
> 2.  if i modify the response headers after the subrequest is performed they DO 

> NOT appear correct within the response

Is the subrequest sending any kind of data to the client?  If so, it'll
trigger sending the response headers.

> i'm using "chunked  transfer-encoding"

You may be reinventing that wheel: Apache will do it for you if your
response spans more than one brigade and doesn't have a Content-Length.

FWIW, this question might be better-suited to the modules-dev list.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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


      

Re: [users@httpd] modifying original request response headers when using subrequests

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 17 Aug 2010 12:51:58 -0700 (PDT)
Peter Janovsky <pe...@yahoo.com> wrote:

> 1.  if i modify the response headers before the subrequest is performed they 
> appear correct within the response
> 2.  if i modify the response headers after the subrequest is performed they DO 
> NOT appear correct within the response

Is the subrequest sending any kind of data to the client?  If so, it'll
trigger sending the response headers.

> i'm using "chunked  transfer-encoding"

You may be reinventing that wheel: Apache will do it for you if your
response spans more than one brigade and doesn't have a Content-Length.

FWIW, this question might be better-suited to the modules-dev list.

-- 
Nick Kew

---------------------------------------------------------------------
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