diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-11 19:58:47 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-11 19:58:47 -0800 |
commit | 7e06c63410304767bc6b0dce4e1e2477934fd816 (patch) | |
tree | f1cb93a2c2b75202d2f55377eac54355002a09fd /system/db/cache.go | |
parent | a20025b452934069fc6c39949d7b9e123a503c9c (diff) |
returning api server middleware to original state and adding req header lookup for cache implementation
Diffstat (limited to 'system/db/cache.go')
-rw-r--r-- | system/db/cache.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/db/cache.go b/system/db/cache.go index 4076848..e964906 100644 --- a/system/db/cache.go +++ b/system/db/cache.go @@ -18,7 +18,7 @@ func CacheControl(next http.Handler) http.HandlerFunc { res.Header().Add("Etag", etag) res.Header().Add("Cache-Control", policy) - if match := res.Header().Get("If-None-Match"); match != "" { + if match := req.Header.Get("If-None-Match"); match != "" { if strings.Contains(match, etag) { fmt.Println("matched etag") res.WriteHeader(http.StatusNotModified) |