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

vicanso/fresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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