You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Liudonghua (Eric)" <er...@huawei.com> on 2012/12/13 13:39:02 UTC

答复: [users@httpd] how to dynamically set a request header befor send the content handler is run

Thanks, now I make it work.
I use an environment variable and requestHeader without early keyword to implement my requirement.
I should read the document more carefully next time.

发件人: Serge Fonville [mailto:serge.fonville@gmail.com]
发送时间: 2012年12月13日 17:56
收件人: users@httpd.apache.org
主题: Re: [users@httpd] how to dynamically set a request header befor send the content handler is run

Hi,

Is it correct to interpret this as "I want to create a new requestheader, based on the values of a client-provided requestheader"?

From http://httpd.apache.org/docs/2.2/mod/mod_headers.html "Request Headers are set immediately before running the content generator and Response Headers just as the response is sent down the wire."

Based on this you should be able to use an environment variable that is used as part of an expression to define the value of the new header.

Perhaps if you further clarify exactly what you are trying to do, others maybe better able to answer your question.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table


2012/12/13 Liudonghua (Eric) <er...@huawei.com>>
I have already read the mod_headers configure document (http://httpd.apache.org/docs/2.4/mod/mod_headers.html).
And I see early requestheader maybe solve my problem.
RequestHeader add|append|edit|edit*|merge|set|unset header [value] [replacement] [early|env=[!]variable]|expr=expression]
For my requirement that I need to change a request header before the following operation.
For example, a HTTP request contains a header headerName:headerValue. And now I should convert it to NewHeaderName:NewHeaderValue which NewHeaderValue is depend on the headerValue.
Because early and expr=expression in the requestheader syntax can not use together.
How can I achieve this goal.
Thanks in advance.