You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Ravi L <mo...@gmail.com> on 2007/07/09 13:06:55 UTC
ap_http_header_filter() strips off custom resp headers
Hi all,
Why does Apache httpd strip of the custom response headers when the
resp-code is "304-Not Modified"?
I have the following scenario :
A client sends request to Apache httpd, and the request is handled by some
module. The module's content handler sets the response status to
HTTP_NOT_MODIFIED, and adds some custom response headers to "headers_out".
But, ap_http_header_filter() strips all the headers other than some specific
headers. Why should it not send the custom headers?
thanks
ravi
Re: ap_http_header_filter() strips off custom resp headers
Posted by Ravi L <mo...@gmail.com>.
On 7/9/07, Graham Dumpleton <gr...@gmail.com> wrote:
>
> On 09/07/07, Ravi L <mo...@gmail.com> wrote:
> > Hi all,
> >
> > Why does Apache httpd strip of the custom response headers when the
> > resp-code is "304-Not Modified"?
> >
> > I have the following scenario :
> >
> > A client sends request to Apache httpd, and the request is handled by
> some
> > module. The module's content handler sets the response status to
> > HTTP_NOT_MODIFIED, and adds some custom response headers to
> "headers_out".
> > But, ap_http_header_filter() strips all the headers other than some
> specific
> > headers. Why should it not send the custom headers?
>
> What happens if those headers are add to err_headers_out instead?
> Those put in err_headers_out are treated differently in certain cases.
> Quoting from httpd.h:
>
> * The difference between headers_out and err_headers_out is that the
> * latter are printed even on error, and persist across internal
> redirects
> * (so the headers printed for ErrorDocument handlers will have them).
Right. But it would be nice to know if there is a specific reason for Apache
httpd stripping off the headers as in the above case. As I understand, RFC
2616(Section 10.3.5) does not say anything about this.
Could someone please throw some light on this?
thanks
ravi
Graham
>
Re: ap_http_header_filter() strips off custom resp headers
Posted by Graham Dumpleton <gr...@gmail.com>.
On 09/07/07, Ravi L <mo...@gmail.com> wrote:
> Hi all,
>
> Why does Apache httpd strip of the custom response headers when the
> resp-code is "304-Not Modified"?
>
> I have the following scenario :
>
> A client sends request to Apache httpd, and the request is handled by some
> module. The module's content handler sets the response status to
> HTTP_NOT_MODIFIED, and adds some custom response headers to "headers_out".
> But, ap_http_header_filter() strips all the headers other than some specific
> headers. Why should it not send the custom headers?
What happens if those headers are add to err_headers_out instead?
Those put in err_headers_out are treated differently in certain cases.
Quoting from httpd.h:
* The difference between headers_out and err_headers_out is that the
* latter are printed even on error, and persist across internal redirects
* (so the headers printed for ErrorDocument handlers will have them).
Graham