From 65fc4b45e9f74fdc42ec60a2ae89d8487aa9ce59 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 3 Jan 2019 17:00:55 -0800 Subject: [PATCH] gateway index: fix check for displaying CID. License: MIT Signed-off-by: Steven Allen --- 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 b850578f4..6b7c15d41 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -348,7 +348,7 @@ func (i *gatewayHandler) getOrHeadHandler(ctx context.Context, w http.ResponseWr } var hash string - if !strings.Contains(originalUrlPath, "ipfs") { + if !strings.HasPrefix(originalUrlPath, ipfsPathPrefix) { hash = resolvedPath.Cid().String() }