check strong and weak ETag validator
CDN may change strong ETag validator to weak ETag validator. License: MIT Signed-off-by: Ivan <ivan386@users.noreply.github.com>
Ivan committed
Jun 14, 2017 at 23:01 UTC
8b88b7ffd2dce4ffaf69087c5e1962ace18f27d8
1 file changed
+1
-1
core/corehttp/gateway_handler.go
+1
-1
@@ -197,7 +197,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr
197
198
// Check etag send back to us
199
etag := "\"" + resolvedPath.Cid().String() + "\""
200
- if r.Header.Get("If-None-Match") == etag {
200
+ if r.Header.Get("If-None-Match") == etag || r.Header.Get("If-None-Match") == "W/"+etag {
201
w.WriteHeader(http.StatusNotModified)
202
return
203
}