Skip to content

Commit

Permalink
update makeRequest to use requestCopy as reference
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamc-ins committed Nov 21, 2024
1 parent 5e78df8 commit ff2df10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adapters/insticator/insticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte

request.Ext = reqExt

// Create a deep copy of the request to avoid modifying the original request
// Create a copy of the request to avoid modifying the original request
requestCopy := *request

for i := 0; i < len(request.Imp); i++ {
Expand Down Expand Up @@ -120,7 +120,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
}

for _, impList := range groupedImps {
if adapterReq, err := a.makeRequest(requestCopy, impList); err == nil {
if adapterReq, err := a.makeRequest(&requestCopy, impList); err == nil {
adapterRequests = append(adapterRequests, adapterReq)
} else {
errs = append(errs, err)
Expand All @@ -129,7 +129,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
return adapterRequests, errs
}

func (a *adapter) makeRequest(request openrtb2.BidRequest, impList []openrtb2.Imp) (*adapters.RequestData, error) {
func (a *adapter) makeRequest(request *openrtb2.BidRequest, impList []openrtb2.Imp) (*adapters.RequestData, error) {
request.Imp = impList

reqJSON, err := jsonutil.Marshal(request)
Expand Down

0 comments on commit ff2df10

Please sign in to comment.