Skip to content

Commit

Permalink
Apply feedback from @SyntaxNode in ##1287
Browse files Browse the repository at this point in the history
Co-authored-by: Mirko Feddern <mirkorean@users.noreply.github.com>
Signed-off-by: Alex Klinkert <alex@klinkert.io>
  • Loading branch information
aklinkert and mirkorean committed May 29, 2020
1 parent 85386ea commit 9a6aed4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion adapters/yieldlab/usersync.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import (
)

func NewYieldlabSyncer(temp *template.Template) usersync.Usersyncer {
return adapters.NewSyncer("yieldlab", 0, temp, adapters.SyncTypeRedirect)
return adapters.NewSyncer("yieldlab", 70, temp, adapters.SyncTypeRedirect)
}
2 changes: 1 addition & 1 deletion adapters/yieldlab/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func TestYieldlabSyncer(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, "https://ad.yieldlab.net/mr?t=2&pid=9140838&gdpr=0&gdpr_consent=&redirectUri=http%3A%2F%2Flocalhost%2F%2Fsetuid%3Fbidder%3Dyieldlab%26gdpr%3D0%26gdpr_consent%3D%26uid%3D%25%25YL_UID%25%25", syncInfo.URL)
assert.Equal(t, "redirect", syncInfo.Type)
assert.EqualValues(t, 0, syncer.GDPRVendorID())
assert.EqualValues(t, 70, syncer.GDPRVendorID())
assert.False(t, syncInfo.SupportCORS)
}
9 changes: 7 additions & 2 deletions adapters/yieldlab/yieldlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"golang.org/x/text/currency"

"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
)

Expand Down Expand Up @@ -187,14 +188,18 @@ func (a *YieldlabAdapter) mergeParams(params []*openrtb_ext.ExtImpYieldlab) *ope
func (a *YieldlabAdapter) MakeBids(internalRequest *openrtb.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
if response.StatusCode != 200 {
return nil, []error{
fmt.Errorf("failed to resolve bids from yieldlab response: Unexpected response code %v", response.StatusCode),
&errortypes.BadServerResponse{
Message: fmt.Sprintf("failed to resolve bids from yieldlab response: Unexpected response code %v", response.StatusCode),
},
}
}

bids := make([]*bidResponse, 0)
if err := json.Unmarshal(response.Body, &bids); err != nil {
return nil, []error{
fmt.Errorf("failed to parse bids response from yieldlab: %v", err),
&errortypes.BadServerResponse{
Message: fmt.Sprintf("failed to parse bids response from yieldlab: %v", err),
},
}
}

Expand Down

0 comments on commit 9a6aed4

Please sign in to comment.