HTTP response freshness testing,it is copied from fresh by golang.
RequestHeader
ResponseHeader
req := httptest.NewRequest("GET", "/users/me", nil)
resp := httptest.NewRecorder()
// true
Fresh(req.Header, resp.Header)
-
modifiedSince
IfNoneMatch of request header field -
noneMatch
IfNoneMatch of request header field -
cacheControl
Cache-Control of request header field -
lastModified
LastModified of response header field -
eTag
ETag of response header field
Check([]byte("Sat, 01 Jan 2000 00:00:00 GMT"), []byte("\"foo\""), nil, []byte("Sat, 01 Jan 2000 00:00:00 GMT"), []byte("\"foo\""))