vicanso / fresh

HTTP request freshness testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

HTTP request freshness testing

License:MIT License


Languages

Language:Go 97.4%Language:Makefile 2.6%