Re: Change Last-Modified response

From: Willy Tarreau <w#1wt.eu>
Date: Sat, 3 Dec 2011 23:27:55 +0100


On Sat, Dec 03, 2011 at 11:15:31PM +0100, Francesco Latini wrote:
> Hi Willy,
> Il giorno 03/dic/2011 23:00, "Willy Tarreau" <w#1wt.eu> ha scritto:
> >
> > Hi Francesco,
> >
> > On Fri, Dec 02, 2011 at 12:34:53PM +0100, Francesco Latini wrote:
> > > Hi all,
> > > I have a problem with the HTTP Header Manipulation. I have added a
> > > Cache-Control response and deleted a Server response with HAproxy
> keywords
> > > rspadd and rspdel.
> > > There is a way to modify a Last-Modified response with the date of the
> > > request? A keyword like a `date '+%Y-%m-%d'`?
> >
> > No there is no way to do this. But why on earth are you trying to do
> > this ? Wouldn't it be possible in your case to emit a header in the
> > future or in the past ? Or simply to delete it ? Or couldn't you just
> > rename the Date header "Last-Modified" ?
>
> I have a problem to manipulate the Header with the backend (developed in
> Erlang).

Well, I don't see why you'd need to manipulate it first. You may as well decide to simply remove it instead of emitting random data in it.

> So if there is no way to make it with HAproxy, I have no chance to
> learn how to make it with Erlang.

As I suggested if you really know you need the current date, and your server emits a correct Date header, you could rename it so that it becomes your Last-Modified header :

    rspdel ^Last-Modified:
    rspirep ^Date:(.*) Last-Modified:\1

But this is dirty.

Regards,
Willy Received on 2011/12/03 23:27

This archive was generated by hypermail 2.2.0 : 2011/12/03 23:30 CET