Skip to content

Commit

Permalink
Merge pull request ipfs/kubo#3983 from ivan386/patch-3
Browse files Browse the repository at this point in the history
check strong and weak ETag validator

This commit was moved from ipfs/kubo@a234c56
  • Loading branch information
whyrusleeping authored Dec 4, 2017
2 parents 269cdb9 + 1d1795d commit 31c693e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/core/corehttp/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 31c693e

Please sign in to comment.