From 8b88b7ffd2dce4ffaf69087c5e1962ace18f27d8 Mon Sep 17 00:00:00 2001 From: Ivan Date: Wed, 14 Jun 2017 23:01:48 +0300 Subject: [PATCH] check strong and weak ETag validator CDN may change strong ETag validator to weak ETag validator. License: MIT Signed-off-by: Ivan --- core/corehttp/gateway_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 113fe52b5..463289121 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -197,7 +197,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 }