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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user