Score:0

Apache include value of %{TIME_YEAR} variable in an HTTP response header

ng flag

I'm trying to do something like the following:

<If "%{IPV6} == 'off'">
  Header always set Attention "you are using still using IPV4 in %{TIME_YEAR}, please blahblah etc"
</If>

(please withhold commentary regarding the viability of communicating with humans through HTTP headers)

without the %{TIME_YEAR} it works fine but with it it gives an error Unrecognized header format %,

removing the % just results in the literal string {TIME_YEAR} being returned in the header

I've tried using expr=%{TIME_YEAR} or %{env:TIME_YEAR} but they error out as well

I've tried adding PassEnv TIME_YEAR prior but it gives an error AH01506: PassEnv variable TIME_YEAR was undefined

TIME_YEAR should be a valid variable according to this: https://httpd.apache.org/docs/2.4/expr.html

I noticed that some variable on that page are tagged as "(not available during <If>)" but there's no such designation on the time variables

I am using Apache 2.4.41 which (as far as I can tell) should be sufficient to have all of this functionality.

Score:1
sb flag

This should work:

Header always set Attention "expr=you are using still using IPV4 in %{TIME_YEAR}, please blahblah etc"

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.