Commit fab42dd
committed
Backport HTTP 'Age' header field
See #2032 / #2067, kudos @Wahnes. This is a backport for 3.0
Currently, when "HTTP clock skew" is calculated, this is taken to be the
difference between the timestamp of the moment the HTTPS request was sent and
the date given in the HTTP Date header. This does not yield valid results in
case a HTTP cache is used, either on the client side or on the server side.
According to the HTTP specs, the Date field will contain the timestamp the
response was created, which may not be the timestamp the response was
delivered.
Consider the following example that queries the Varnish project's web server.
Note that Varnish is a popular HTTP caching server, so HTTP caching will of
course be used when serving HTTP responses from this project's web server.
testssl.sh https://varnish-cache.org/ This will typically output a HTTP clock
skew of some thousand seconds.
The patch takes into account the HTTP Age header that caching servers add to
the HTTP response to signal the response's freshness. As client-side caches
normally do not cache HTTPS requests (except maybe for "enterprise" HTTP proxy
caches that do MITM HTTPS proxying), this is mostly targeted to HTTPS websites
that employ server side HTTP caching.
Addtional polishing:
* address my comments in #2032
* add JSON field HTTP_headerAge if they exists
* output HTTP_AGE if it was detected
* do stripping of line feeds closer to where variables were set1 parent 2cd0ab5 commit fab42dd
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
| |||
2160 | 2161 | | |
2161 | 2162 | | |
2162 | 2163 | | |
| 2164 | + | |
2163 | 2165 | | |
2164 | 2166 | | |
2165 | 2167 | | |
2166 | 2168 | | |
2167 | 2169 | | |
2168 | 2170 | | |
2169 | 2171 | | |
| 2172 | + | |
2170 | 2173 | | |
2171 | 2174 | | |
2172 | 2175 | | |
| |||
2198 | 2201 | | |
2199 | 2202 | | |
2200 | 2203 | | |
2201 | | - | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
2202 | 2207 | | |
2203 | 2208 | | |
2204 | 2209 | | |
| |||
2324 | 2329 | | |
2325 | 2330 | | |
2326 | 2331 | | |
| 2332 | + | |
2327 | 2333 | | |
2328 | | - | |
| 2334 | + | |
2329 | 2335 | | |
2330 | 2336 | | |
2331 | 2337 | | |
2332 | 2338 | | |
2333 | 2339 | | |
2334 | 2340 | | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
2335 | 2347 | | |
2336 | 2348 | | |
2337 | 2349 | | |
2338 | 2350 | | |
2339 | | - | |
| 2351 | + | |
2340 | 2352 | | |
2341 | 2353 | | |
2342 | 2354 | | |
| |||
0 commit comments