@@ -434,7 +434,7 @@ func (s *Source) scanEvent(ctx context.Context, chunksChan chan *sources.Chunk,
434434 metadata .LocationType = source_metadatapb .PostmanLocationType_COLLECTION_SCRIPT
435435 }
436436
437- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (metadata , data )), metadata )
437+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (metadata , data , DefaultMaxRecursionDepth )), metadata )
438438 metadata .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
439439}
440440
@@ -532,7 +532,7 @@ func (s *Source) scanAuth(ctx context.Context, chunksChan chan *sources.Chunk, m
532532 } else if strings .Contains (m .Type , COLLECTION_TYPE ) {
533533 m .LocationType = source_metadatapb .PostmanLocationType_COLLECTION_AUTHORIZATION
534534 }
535- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , authData )), m )
535+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , authData , DefaultMaxRecursionDepth )), m )
536536 m .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
537537}
538538
@@ -555,7 +555,7 @@ func (s *Source) scanHTTPRequest(ctx context.Context, chunksChan chan *sources.C
555555 metadata .Type = originalType + " > header"
556556 metadata .Link = metadata .Link + "?tab=headers"
557557 metadata .LocationType = source_metadatapb .PostmanLocationType_REQUEST_HEADER
558- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (metadata , strings .Join (r .HeaderString , " " ))), metadata )
558+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (metadata , strings .Join (r .HeaderString , " " ), DefaultMaxRecursionDepth )), metadata )
559559 metadata .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
560560 }
561561
@@ -564,7 +564,7 @@ func (s *Source) scanHTTPRequest(ctx context.Context, chunksChan chan *sources.C
564564 // Note: query parameters are handled separately
565565 u := fmt .Sprintf ("%s://%s/%s" , r .URL .Protocol , strings .Join (r .URL .Host , "." ), strings .Join (r .URL .Path , "/" ))
566566 metadata .LocationType = source_metadatapb .PostmanLocationType_REQUEST_URL
567- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (metadata , u )), metadata )
567+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (metadata , u , DefaultMaxRecursionDepth )), metadata )
568568 metadata .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
569569 }
570570
@@ -615,13 +615,13 @@ func (s *Source) scanRequestBody(ctx context.Context, chunksChan chan *sources.C
615615 m .Type = originalType + " > raw"
616616 data := b .Raw
617617 m .LocationType = source_metadatapb .PostmanLocationType_REQUEST_BODY_RAW
618- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , data )), m )
618+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , data , DefaultMaxRecursionDepth )), m )
619619 m .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
620620 case "graphql" :
621621 m .Type = originalType + " > graphql"
622622 data := b .GraphQL .Query + " " + b .GraphQL .Variables
623623 m .LocationType = source_metadatapb .PostmanLocationType_REQUEST_BODY_GRAPHQL
624- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , data )), m )
624+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , data , DefaultMaxRecursionDepth )), m )
625625 m .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
626626 }
627627}
@@ -647,15 +647,15 @@ func (s *Source) scanHTTPResponse(ctx context.Context, chunksChan chan *sources.
647647 m .Type = originalType + " > response header"
648648 // TODO Note: for now, links to Postman responses do not include a more granular tab for the params/header/body, but when they do, we will need to update the metadata.Link info
649649 m .LocationType = source_metadatapb .PostmanLocationType_RESPONSE_HEADER
650- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , strings .Join (response .HeaderString , " " ))), m )
650+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , strings .Join (response .HeaderString , " " ), DefaultMaxRecursionDepth )), m )
651651 m .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
652652 }
653653
654654 // Body in a response is just a string
655655 if response .Body != "" {
656656 m .Type = originalType + " > response body"
657657 m .LocationType = source_metadatapb .PostmanLocationType_RESPONSE_BODY
658- s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , response .Body )), m )
658+ s .scanData (ctx , chunksChan , s .formatAndInjectKeywords (s .buildSubstituteSet (m , response .Body , DefaultMaxRecursionDepth )), m )
659659 m .LocationType = source_metadatapb .PostmanLocationType_UNKNOWN_POSTMAN
660660 }
661661
@@ -688,7 +688,7 @@ func (s *Source) scanVariableData(ctx context.Context, chunksChan chan *sources.
688688 if valStr == "" {
689689 continue
690690 }
691- values = append (values , s .buildSubstituteSet (m , valStr )... )
691+ values = append (values , s .buildSubstituteSet (m , valStr , DefaultMaxRecursionDepth )... )
692692 }
693693
694694 m .FieldType = m .Type + " variables"
0 commit comments