Cmag
Cmag

Reputation: 15770

apache mod_headers Date: Header

Folks, Need to convert the following request header to a different format:

RequestHeader set Date "%{TIME_WDAY}e"

The %t variable looks like :

t=1367272677754275

Would like the Date= to look like:

Date: Tue, 27 Mar 2007 19:44:46 +0000

How is this done?

Thanks!

Upvotes: 1

Views: 2262

Answers (2)

Cmag
Cmag

Reputation: 15770

Correct answer here is a mod_headers.c patch to add additional authentication information required by AWS and GCS

Upvotes: 0

likeitlikeit
likeitlikeit

Reputation: 5638

You cannot do that with the documented functionality of mod_headers. This module only supports the follwing variables (from the doc):

%t          The time the request was received in Universal Coordinated Time since the epoch (Jan. 1, 1970) measured in microseconds. The value is preceded by t=.
%D          The time from when the request was received to the time the headers are sent on the wire. This is a measure of the duration of the request. The value is preceded by D=. The value is measured in microseconds.
%{FOOBAR}e  The contents of the environment variable FOOBAR.
%{FOOBAR}s  The contents of the SSL environment variable FOOBAR, if mod_ssl is enabled.

Unless you continually want to set an environment variable to your current date and pull it in using mod_env, I suggest you use mod_rewrite.

Upvotes: 1

Related Questions