tempesta icon indicating copy to clipboard operation
tempesta copied to clipboard

Wrong Age header

Open const-t opened this issue 3 years ago • 3 comments

Looks like Age header calculates using Date header from backend, when backend returns incorrect Date Age also be incorrect.

How to reproduce: Respond to tempesta with incorrect Date with enabled caching on tempesta.

const-t avatar Sep 29 '22 16:09 const-t

What is the correct calculation scheme for Age if Date from a backend is incorrect? Isn't this just a foot-shooting by the backend?

krizhanovsky avatar Sep 29 '22 16:09 krizhanovsky

RFC 9110 6.6.1 says:

A recipient with a clock that receives a response with an invalid Date header field value MAY replace that value with the time that response was received

IIUC it's not necessary, however we can replace Date. Yes, it's foot-shooting, but in general we should know about such behaviour of tempesta.

For instance: Sat, 01 Oct 2022 7:19:16 GMT this date is incorrect. Hours specified without leading zero. Resulted Age is something like this Age: 1664612639.

const-t avatar Oct 01 '22 08:10 const-t

OK, I see. This is the "MAY" feature - it'd be good to have this, but nobody will blame us if we don't do this, so I move this to backlog.

krizhanovsky avatar Oct 01 '22 09:10 krizhanovsky