From 3b6a259950d2e8ce842a117a6f47d140f31cc095 Mon Sep 17 00:00:00 2001 From: Wondertan Date: Wed, 16 Aug 2023 09:53:47 +0200 Subject: [PATCH] prevent reassignments of global DefaultAllowList --- blockservice/blockservice.go | 2 +- verifcid/allowlist.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blockservice/blockservice.go b/blockservice/blockservice.go index 11763ddba..37c4b35da 100644 --- a/blockservice/blockservice.go +++ b/blockservice/blockservice.go @@ -145,7 +145,7 @@ func (s *blockService) Allowlist() verifcid.Allowlist { // session will be created. Otherwise, the current exchange will be used // directly. func NewSession(ctx context.Context, bs BlockService) *Session { - allowlist := verifcid.DefaultAllowlist + allowlist := verifcid.Allowlist(verifcid.DefaultAllowlist) if bbs, ok := bs.(BoundedBlockService); ok { allowlist = bbs.Allowlist() } diff --git a/verifcid/allowlist.go b/verifcid/allowlist.go index 12690b783..b572de3a6 100644 --- a/verifcid/allowlist.go +++ b/verifcid/allowlist.go @@ -5,7 +5,7 @@ import ( ) // DefaultAllowlist is the default list of hashes allowed in IPFS. -var DefaultAllowlist Allowlist = defaultAllowlist{} +var DefaultAllowlist defaultAllowlist // Allowlist defines an interface containing list of allowed multihashes. type Allowlist interface {