Q: Howto add Last-modified to the header?
Hi, I want to add a Last-modified line to the header. This line seams to work: <dtml-call "RESPONSE.setHeader('Last-Modified', '2000/05/14 13:15:45.0533 GMT+1')"> BUT how can I change the time, e.g. using <dtml-var bobobase_modification_time> The following line isnŽt working <dtml-call "RESPONSE.setHeader('Last-Modified', '<dtml-var bobobase_modification_time>')"> How can I expand <dtml-var bobobase_modification_time> to a string, that I can pass to the setHeader method call?? Thanks Christian -- Dipl.-Ing. Christian Leutloff, Aachen, Germany christian@leutloff.de http://www.oche.de/~leutloff/ leutloff@debian.org Debian GNU/Linux - http://www.de.debian.org/
Christian Leutloff wrote:
This line seams to work: <dtml-call "RESPONSE.setHeader('Last-Modified', '2000/05/14 13:15:45.0533 GMT+1')">
Actually, that doesn't look like a valid date format for HTTP headers (refer to RFC 2616 for details). It should look something more like "Sat, 13 May 2000 22:37:47 GMT" (with no offset on GMT).
The following line isn´t working <dtml-call "RESPONSE.setHeader('Last-Modified', '<dtml-var bobobase_modification_time>')">
Whenever you are within double quotes, you are using a Python expression, so <dtml-*> will no longer work. Also, using '' is a string literal, so you would have literally been setting Last-Modified to "<dtml-var bobobase_modification_time>". Try something like: <dtml-call "RESPONSE.setHeader('Last-Modified', _['bobobase_modification_time'])> Regards, Daryl Tester
participants (2)
-
Christian Leutloff -
Daryl Tester