Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Latest commit

 

History

History
36 lines (22 loc) · 826 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 826 Bytes

fresh

Build Status

HTTP response freshness testing,it is copied from fresh by golang.

API

Fresh

  • RequestHeader
  • ResponseHeader
req := httptest.NewRequest("GET", "/users/me", nil)
resp := httptest.NewRecorder()
// true
Fresh(req.Header, resp.Header)

Check

  • 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\""))