Skip to content

Commit

Permalink
set TrafficGate
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad committed May 24, 2022
1 parent b127f22 commit 34c4023
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions adapters/trafficgate/trafficgate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ type BidResponseExt struct {

func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {

errs := make([]error, 0, len(request.Imp))
headers := http.Header{
"Content-Type": {"application/json"},
"Accept": {"application/json"},
}

// Pull the host and source ID info from the bidder params.
reqImps, err := splitImpressions(request.Imp)

if err != nil {
errs = append(errs, err)
return nil, []error{err}
}

requests := []*adapters.RequestData{}

var errs []error
for reqExt, reqImp := range reqImps {
request.Imp = reqImp
reqJson, err := json.Marshal(request)
Expand Down Expand Up @@ -133,12 +132,7 @@ func splitImpressions(imps []openrtb2.Imp) (map[openrtb_ext.ExtImpTrafficGate][]
return nil, err
}

arrImps, ok := multipleImps[*bidderParams]
if ok {
multipleImps[*bidderParams] = append(arrImps, imp)
} else {
multipleImps[*bidderParams] = []openrtb2.Imp{imp}
}
multipleImps[*bidderParams] = append(multipleImps[*bidderParams], imp)
}

return multipleImps, nil
Expand Down

0 comments on commit 34c4023

Please sign in to comment.