Add a variable on http header

2011-06-06 Thread Maurizio Totti
Hi,
I would try to set an http header variable on the fly but without success :-(
I write this simple module to test the functionality

http://pastebin.com/b8hcZTtb

I don't understand my error, someone can help me?
Thanks a lot

Regards.

-- 
Maurizio Totti


Re: Add a variable on http header

2011-06-06 Thread Robert Schulze

Hi,

Am 06.06.2011 14:15, schrieb Maurizio Totti:

Hi,
I would try to set an http header variable on the fly but without success :-(
I write this simple module to test the functionality


why writing a module for that? Better use Add|SetHeader et al from 
mod_headers.


with kind regards,
Robert Schulze


Re: Add a variable on http header

2011-06-06 Thread Sorin Manolache
On Mon, Jun 6, 2011 at 14:15, Maurizio Totti maurizio.to...@gmail.com wrote:
 Hi,
 I would try to set an http header variable on the fly but without success 
 :-(
 I write this simple module to test the functionality

 http://pastebin.com/b8hcZTtb

When running your code, I see USER_VAR2: mytest in the response.

Be aware that your code adds a _request_ header (r-headers_in) to an
_output_ filter.

S


 I don't understand my error, someone can help me?
 Thanks a lot

 Regards.

 --
 Maurizio Totti



Re: Add a variable on http header

2011-06-06 Thread Simone Caruso
On 06/06/2011 14:15, Maurizio Totti wrote:
 Hi,
 I would try to set an http header variable on the fly but without success 
 :-(
 I write this simple module to test the functionality
 
 http://pastebin.com/b8hcZTtb
 
 I don't understand my error, someone can help me?
 Thanks a lot
 
 Regards.
 
Changing,in line 22, from 'headers_in' to 'headers_out' make your module work in
my test env only for non-html content.

Of course i set SetHandler getadsldap in my conf.

-- 
Simone Caruso
IT Consultant
+39 349 65 90 805
p.iva: 03045250838


Re: Add a variable on http header

2011-06-06 Thread Maurizio Totti
2011/6/6 Simone Caruso i...@simonecaruso.com:
 Changing,in line 22, from 'headers_in' to 'headers_out' make your module work 
 in
 my test env only for non-html content.

 Of course i set SetHandler getadsldap in my conf.

Hi at all,
@Ben Noordhuis: I had tried all of them to test all the possibility. I
don't get any error (in error.log on debug log level) but the
USER_VAR2 isn't in my http header. Yes I've found the source code of
this module, but my test code it's very more easy, and I've not found
what I have lost :-(

@Sorin Manolache  @Simone Caruso: Ops... :-(
It's correct now, but no change in my http response. My backend's test
it's done with phpinfo() function. Maybe it's a wrong method?

Thanks at all for your help :-)
Regards

-- 
Maurizio Totti


Re: Add a variable on http header

2011-06-06 Thread Sorin Manolache
On Mon, Jun 6, 2011 at 16:14, Maurizio Totti maurizio.to...@gmail.com wrote:
 2011/6/6 Simone Caruso i...@simonecaruso.com:
 Changing,in line 22, from 'headers_in' to 'headers_out' make your module 
 work in
 my test env only for non-html content.

 Of course i set SetHandler getadsldap in my conf.

 Hi at all,
 @Ben Noordhuis: I had tried all of them to test all the possibility. I
 don't get any error (in error.log on debug log level) but the
 USER_VAR2 isn't in my http header. Yes I've found the source code of
 this module, but my test code it's very more easy, and I've not found
 what I have lost :-(

 @Sorin Manolache  @Simone Caruso: Ops... :-(
 It's correct now, but no change in my http response.

I think that an AP_FTYPE_RESOURCE filter is invoked _after_ the HTTP
response headers have been sent to the client.

Try
AP_FTYPE_PROTOCOL - 1
instead of AP_FTYPE_RESOURCE.

S

 My backend's test
 it's done with phpinfo() function. Maybe it's a wrong method?

 Thanks at all for your help :-)
 Regards

 --
 Maurizio Totti



Re: Add a variable on http header

2011-06-06 Thread Maurizio Totti
2011/6/6 Sorin Manolache sor...@gmail.com:

 I think that an AP_FTYPE_RESOURCE filter is invoked _after_ the HTTP
 response headers have been sent to the client.

 Try
 AP_FTYPE_PROTOCOL - 1
 instead of AP_FTYPE_RESOURCE.

Hi Sortin,
I have selected the handler way instead filter.
The module set USER_VAR2 on http header, but not in conjunction with PHP script.
I will study better mod_headers to understand how it works. Thanks!

Regards
-- 
Maurizio Totti


Re: Vary:User-Agent, best practices, and making the web faster.

2011-06-06 Thread Ben Noordhuis
On Sun, Jun 5, 2011 at 21:37, Joshua Marantz jmara...@google.com wrote:
 Does Magento actually vary the content of CSS  JS based on user-agent?  Or
 does it only vary the content of HTML?

I don't know. I'm by no means a Magento expert, I only run into it
from time to time. That site I broke? That was in the summer of 2009
while beefing up the security and performance of a large retailer's
web shop, mostly by putting stuff behind reverse proxies.