1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-27 07:57:30 +08:00

Merge pull request #3983 from ivan386/patch-3

check strong and weak ETag validator
This commit is contained in:
Whyrusleeping
2017-12-04 20:36:43 +01:00
committed by GitHub

View File

@ -198,7 +198,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
// Check etag send back to us
etag := "\"" + resolvedPath.Cid().String() + "\""
if r.Header.Get("If-None-Match") == etag {
if r.Header.Get("If-None-Match") == etag || r.Header.Get("If-None-Match") == "W/"+etag {
w.WriteHeader(http.StatusNotModified)
return
}