jech / polipo

The Polipo caching HTTP proxy
http://www.pps.jussieu.fr/~jch/software/polipo/
MIT License
1.8k stars 353 forks source link

Age is mistakenly generated for newly obtained responses #80

Open vfaronov opened 8 years ago

vfaronov commented 8 years ago

RFC 7234 § 5.1:

The presence of an Age header field implies that the response was not generated or validated by the origin server for this request.

However, Polipo generates an Age header even for responses that were just obtained from the origin server, if the delays accumulate to at least 1 second. For example:

$ curl -si --proxy http://localhost:8123 httpbin.org/delay/5 | head
HTTP/1.1 200 OK
Content-Length: 262
Date: Sat, 30 Jan 2016 13:09:00 GMT
Via: 1.1 polipo
Server: nginx
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Age: 5
Connection: keep-alive

Fixing this would probably make the spurious Warning headers easy to fix as well.