Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Get the app id from the parameters for Conversant (prebid#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwier authored and hhhjort committed Jun 18, 2019
1 parent 9f1c4d6 commit 9be2670
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 deletions adapters/conversant/conversant.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ func (a *ConversantAdapter) Call(ctx context.Context, req *pbs.PBSRequest, bidde
}

// Fill in additional Site info

if params.SiteID != "" && !(cnvrReq.Site == nil) {
cnvrReq.Site.ID = params.SiteID
if params.SiteID != "" {
if cnvrReq.Site != nil {
cnvrReq.Site.ID = params.SiteID
}
if cnvrReq.App != nil {
cnvrReq.App.ID = params.SiteID
}
}

if params.Mobile != nil && !(cnvrReq.Site == nil) {
Expand Down
7 changes: 4 additions & 3 deletions adapters/conversant/conversant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func TestConversantInappVideoRequest(t *testing.T) {
conf := *adapters.DefaultHTTPAdapterConfig
an := NewConversantAdapter(&conf, server.URL)

requestParam := `{"secure": 1}`
appParam := `{ "Id": "12345" }`
requestParam := `{"secure": 1, "site_id": "12345"}`
appParam := `{ "bundle": "com.naver.linewebtoon" }`
videoParam := `{ "mimes": ["video/x-ms-wmv"],
"protocols": [1, 2],
"maxduration": 90 }`
Expand Down Expand Up @@ -268,10 +268,11 @@ func TestConversantInappBannerRequest(t *testing.T) {
an := NewConversantAdapter(&conf, server.URL)

param := `{ "secure": 1,
"site_id": "12345",
"tag_id": "top",
"position": 2,
"bidfloor": 1.01 }`
appParam := `{ "Id": "12345" }`
appParam := `{ "bundle": "com.naver.linewebtoon" }`

ctx := context.TODO()
pbReq, _ := CreateBannerRequest(param)
Expand Down

0 comments on commit 9be2670

Please sign in to comment.