Skip to content

Commit

Permalink
Do not end up with empty-name denylist when none specified
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Oct 18, 2023
1 parent 1964b01 commit 19602c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ to create libp2p identities for the gateway.
return err
}

var denylists []string
if list := cctx.String("denylists"); len(list) > 0 {
denylists = strings.Split(list, ",")
}

Check warning on line 201 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L198-L201

Added lines #L198 - L201 were not covered by tests

cfg := Config{

Check warning on line 203 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L203

Added line #L203 was not covered by tests
DataDir: ddir,
GatewayDomain: cctx.String("gateway-domain"),

Check warning on line 205 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L205

Added line #L205 was not covered by tests
Expand All @@ -209,7 +214,7 @@ to create libp2p identities for the gateway.
KuboRPCURLs: getEnvs(EnvKuboRPC, DefaultKuboRPC),
DHTSharedHost: cctx.Bool("dht-fallback-shared-host"),
DNSCache: cdns,
DenylistSubs: strings.Split(cctx.String("denylists"), ","),
DenylistSubs: denylists,
}
gnd, err := Setup(cctx.Context, cfg)

Check warning on line 219 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L217-L219

Added lines #L217 - L219 were not covered by tests
if err != nil {
Expand Down

0 comments on commit 19602c9

Please sign in to comment.