Skip to content

Commit

Permalink
Do not allow empty value for CidSchemaHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Aug 30, 2024
1 parent eef1b63 commit 53c0429
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dagsync/ipnisync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (s *Syncer) Sync(ctx context.Context, nextCid cid.Cid, sel ipld.Node) error
reqType, ok := ctx.Value(CidSchemaHeader).(string)
if ok {
switch reqType {
case CidSchemaAd, CidSchemaEntries, "":
case CidSchemaAd, CidSchemaEntries:
default:
return fmt.Errorf("invalid cid schema type: %s", reqType)
}
Expand Down Expand Up @@ -329,7 +329,7 @@ retry:
}

reqType, ok := ctx.Value(CidSchemaHeader).(string)
if ok && reqType != "" {
if ok {
req.Header.Set(CidSchemaHeader, reqType)
}

Expand Down

0 comments on commit 53c0429

Please sign in to comment.