Skip to content

Commit

Permalink
AdkernelAdn: static endpoint host (prebid#2185)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckbo3hrk authored Mar 21, 2022
1 parent 10295f6 commit 0f735f3
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 22 deletions.
9 changes: 1 addition & 8 deletions adapters/adkernelAdn/adkernelAdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"github.com/prebid/prebid-server/openrtb_ext"
)

const defaultDomain string = "tag.adkernel.com"

type adkernelAdnAdapter struct {
EndpointTemplate *template.Template
}
Expand Down Expand Up @@ -103,7 +101,6 @@ func dispatchImpressions(imps []openrtb2.Imp, impsExt []openrtb_ext.ExtImpAdkern
res[impExt] = make([]openrtb2.Imp, 0)
}
res[impExt] = append(res[impExt], imp)

}
return res, errors
}
Expand Down Expand Up @@ -212,12 +209,8 @@ func createBidRequest(prebidBidRequest *openrtb2.BidRequest, params *openrtb_ext

// Builds enpoint url based on adapter-specific pub settings from imp.ext
func (adapter *adkernelAdnAdapter) buildEndpointURL(params *openrtb_ext.ExtImpAdkernelAdn) (string, error) {
reqHost := defaultDomain
if params.Host != "" {
reqHost = params.Host
}
pubIDStr := strconv.Itoa(params.PublisherID)
endpointParams := macros.EndpointTemplateParams{Host: reqHost, PublisherID: pubIDStr}
endpointParams := macros.EndpointTemplateParams{PublisherID: pubIDStr}
return macros.ResolveMacros(adapter.EndpointTemplate, endpointParams)
}

Expand Down
2 changes: 1 addition & 1 deletion adapters/adkernelAdn/adkernelAdn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdkernelAdn, config.Adapter{
Endpoint: "http://{{.Host}}/rtbpub?account={{.PublisherID}}"})
Endpoint: "https://pbs2.adksrv.com/rtbpub?account={{.PublisherID}}"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://tag.test.com/rtbpub?account=102",
"uri": "https://pbs2.adksrv.com/rtbpub?account=102",
"body": {
"id": "0000000000001",
"imp": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://tag.test.com/rtbpub?account=101",
"uri": "https://pbs2.adksrv.com/rtbpub?account=101",
"body": {
"id": "0000000000001",
"imp": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://tag.test.com/rtbpub?account=102",
"uri": "https://pbs2.adksrv.com/rtbpub?account=102",
"body": {
"id": "0000000000001",
"imp": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://tag.test.com/rtbpub?account=101",
"uri": "https://pbs2.adksrv.com/rtbpub?account=101",
"body": {
"id": "0000000000001",
"imp": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://tag.test.com/rtbpub?account=101",
"uri": "https://pbs2.adksrv.com/rtbpub?account=101",
"body": {
"id": "0000000000001",
"imp": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://tag.test.com/rtbpub?account=101",
"uri": "https://pbs2.adksrv.com/rtbpub?account=101",
"body": {
"app": {
"bundle": "com.rovia.angrybirds",
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ func SetupViper(v *viper.Viper, filename string) {
v.SetDefault("adapters.adgeneration.endpoint", "https://d.socdm.com/adsv/v1")
v.SetDefault("adapters.adhese.endpoint", "https://ads-{{.AccountID}}.adhese.com/json")
v.SetDefault("adapters.adkernel.endpoint", "https://pbs.adksrv.com/hb?zone={{.ZoneID}}")
v.SetDefault("adapters.adkerneladn.endpoint", "http://{{.Host}}/rtbpub?account={{.PublisherID}}")
v.SetDefault("adapters.adkerneladn.endpoint", "https://pbs2.adksrv.com/rtbpub?account={{.PublisherID}}")
v.SetDefault("adapters.adman.endpoint", "http://pub.admanmedia.com/?c=o&m=ortb")
v.SetDefault("adapters.admixer.endpoint", "http://inv-nets.admixer.net/pbs.aspx")
v.SetDefault("adapters.adocean.endpoint", "https://{{.Host}}")
Expand Down
3 changes: 1 addition & 2 deletions openrtb_ext/imp_adkernelAdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ package openrtb_ext

// ExtImpAdkernelAdn defines the contract for bidrequest.imp[i].ext.adkernelAdn
type ExtImpAdkernelAdn struct {
PublisherID int `json:"pubId"`
Host string `json:"host,omitempty"`
PublisherID int `json:"pubId"`
}
4 changes: 0 additions & 4 deletions static/bidder-params/adkernelAdn.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
"type": "integer",
"minimum": 1,
"description": "Publisher Id to use."
},
"host": {
"type": "string",
"description": "Network host to send request"
}
},
"required": ["pubId"]
Expand Down

0 comments on commit 0f735f3

Please sign in to comment.