Skip to content

Commit

Permalink
New changes
Browse files Browse the repository at this point in the history
  • Loading branch information
richaudience committed Oct 14, 2021
1 parent 86ef75f commit e961b4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 181 deletions.
11 changes: 2 additions & 9 deletions adapters/richaudience/richaudience.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ type richaudienceDevice struct {
DNT int8 `json:"dnt,omitempty"`
UA string `json:"ua,omitempty"`
}

type richaudienceSite struct {
Domain string `json:"domain,omitempty"`
Page string `json:"page,omitempty"`
}

// Builder builds a new instance of the RichAudience adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {

bidder := &adapter{
endpoint: config.Endpoint,
}
Expand All @@ -60,25 +60,21 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters

func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
richaudienceRequest := richaudienceRequest{}
richaudienceRequest.ID = request.ID

raiHeaders := http.Header{}

setHeaders(&raiHeaders)

richaudienceRequest.ID = request.ID

isUrlSecure := setSite(request, &richaudienceRequest)

resImps, err := setImp(request, &richaudienceRequest, isUrlSecure)

if err != nil {
return nil, []error{err}
}

richaudienceRequest.Imp = resImps

setSite(request, &richaudienceRequest)

if err = setDevice(request, &richaudienceRequest); err != nil {
return nil, []error{err}
}
Expand All @@ -103,7 +99,6 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
}

func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) {

if responseData.StatusCode == http.StatusNoContent {
return nil, nil
}
Expand Down Expand Up @@ -160,7 +155,6 @@ func setImp(request *openrtb2.BidRequest, richaudienceRequest *richaudienceReque
for _, imp := range request.Imp {
var secure = int8(0)
raiExt, errImp := parseImpExt(&imp)

if errImp != nil {
return nil, errImp
}
Expand Down Expand Up @@ -220,7 +214,6 @@ func setSite(request *openrtb2.BidRequest, richaudienceRequest *richaudienceRequ
}

func setDevice(request *openrtb2.BidRequest, richaudienceRequest *richaudienceRequest) (err error) {

if request.Device != nil && request.Device.IP == "" && request.Device.IPv6 == "" {
err = &errortypes.BadInput{
Message: "request.Device.IP is required",
Expand Down
Loading

0 comments on commit e961b4c

Please sign in to comment.