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 Rui Hu <tc...@gmail.com> on 2012/02/29 07:52:47 UTC

about setting r->headers_out

hi,

I want to set "Content-Type" and "Cache-Control" fields in my private
module. So I hooked fixups and used apr_table_setn to set
r->headers_out but nothing happened. Was it thought through?

Thanks for you help!

Best regards,

Rui Hu
----------------------------------------------------------------------------------------
State Key Laboratory of Networking & Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrbupt@gmail.com
-----------------------------------------------------------------------------------------

Re: about setting r->headers_out

Posted by Rui Hu <tc...@gmail.com>.
Thanks!

I tried to hook "handler" and it works well.

Rui Hu

2012/2/29 Sorin Manolache <so...@gmail.com>

> On 02/29/12 07:52, Rui Hu wrote:
>
>> hi,
>>
>> I want to set "Content-Type" and "Cache-Control" fields in my private
>> module. So I hooked fixups and used apr_table_setn to set
>> r->headers_out but nothing happened. Was it thought through?
>>
>> Thanks for you help!
>>
>
> Try to set r->err_headers_out.
>
> For content-type you could check the configuration directive DefaultType.
>
> You could also set Cache-Control with the Headers directive. Check its
> "always" option too.
>
> You can also combine the Headers directive with environment variables set
> in r->subprocess_env. Check http://httpd.apache.org/docs/**
> 2.0/mod/mod_headers.html#**header<http://httpd.apache.org/docs/2.0/mod/mod_headers.html#header>
>
> Regards,
> Sorin
>



-- 
Best regards,

Rui Hu
----------------------------------------------------------------------------------------
State Key Laboratory of Networking & Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrbupt@gmail.com
-----------------------------------------------------------------------------------------

Re: about setting r->headers_out

Posted by Sorin Manolache <so...@gmail.com>.
On 02/29/12 07:52, Rui Hu wrote:
> hi,
>
> I want to set "Content-Type" and "Cache-Control" fields in my private
> module. So I hooked fixups and used apr_table_setn to set
> r->headers_out but nothing happened. Was it thought through?
>
> Thanks for you help!

Try to set r->err_headers_out.

For content-type you could check the configuration directive DefaultType.

You could also set Cache-Control with the Headers directive. Check its 
"always" option too.

You can also combine the Headers directive with environment variables 
set in r->subprocess_env. Check 
http://httpd.apache.org/docs/2.0/mod/mod_headers.html#header

Regards,
Sorin