mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 01:12:24 +08:00
Merge pull request #3983 from ivan386/patch-3
check strong and weak ETag validator
This commit is contained in:
@ -198,7 +198,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
|
|||||||
|
|
||||||
// Check etag send back to us
|
// Check etag send back to us
|
||||||
etag := "\"" + resolvedPath.Cid().String() + "\""
|
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)
|
w.WriteHeader(http.StatusNotModified)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user