eZ Community » Forums » Developer » Specific HTTP header
expandshrink

Specific HTTP header

Specific HTTP header

Tuesday 12 October 2010 2:13:36 pm - 4 replies

Hi community,

My need is the following : I'm developping an extra layer on top of eZPublish and I have to get extra http headers from it without modifying the actual content.
How can I enforce eZPublish to set specific http headers without touching the kernel or developping an extra heavy extension ?

I've found some Cache-Control and other things in the site.ini but it not seems to be a generic mecanism.

Any help will do it.

Tuesday 12 October 2010 2:42:59 pm

Hi,

You should be able to do this in [HTTPHeaderSettings] in site.ini. Just add your header in HeaderList[] and specify it with your_header[]

Don't forget to enable CustomHeader there too

Tuesday 12 October 2010 3:09:39 pm

If you need the editors / the content to be able to set the source of those headers, use the persistent_variable:

. node template sets the desired header in the persistent var

. pagelayout tpl uses a custom template operator to send the header if it finds it in $module_result.persistent_variable

Tuesday 12 October 2010 6:49:09 pm

Thank you, I will try this one tomorrow.

And of course for the persistent_variable.

Wednesday 13 October 2010 3:25:26 pm

Yes it works.

[HTTPHeaderSettings] CustomHeader=enabled 
HeaderList[] HeaderList[]=Content-type 
Content-type[]
Content-type[/]=blabla

Gracias.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from