Skip to content

Commit

Permalink
fix remote fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Mar 3, 2024
1 parent 42095cc commit 3eda66a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions http/ipfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ func (is *ipfsGatewayServer) fetchAllowed(ctx context.Context, c cid.Cid) bool {
return true
}

if !is.config.IPFS.Gateway.Fetch.Enabled {
return false // deny all
}

for _, match := range is.config.IPFS.Gateway.Fetch.AllowList {
if c.Equals(match) {
return true
if is.config.IPFS.Gateway.Fetch.Enabled {
if len(is.config.IPFS.Gateway.Fetch.AllowList) > 0 {
for _, match := range is.config.IPFS.Gateway.Fetch.AllowList {
if c.Equals(match) {
return true
}
}
return false
}
return true
}
return false
}
Expand Down

0 comments on commit 3eda66a

Please sign in to comment.