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

Commit

Permalink
Fixed a bug in the AdkernelAdn usersync code. (prebid#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbemiller authored Nov 2, 2018
1 parent c05a2d5 commit 1a74919
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion adapters/adkernelAdn/usersync.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
const adkernelGDPRVendorID = uint16(14)

func NewAdkernelAdnSyncer(cfg *config.Configuration) usersync.Usersyncer {
usersyncURL := cfg.Adapters[string(openrtb_ext.BidderAdkernelAdn)].UserSyncURL
// Fixes #736
usersyncURL := cfg.Adapters[strings.ToLower(string(openrtb_ext.BidderAdkernelAdn))].UserSyncURL
externalURL := strings.TrimRight(cfg.ExternalURL, "/") + "/setuid?bidder=adkernelAdn&uid={UID}"
return adapters.NewSyncer("adkernelAdn", adkernelGDPRVendorID, adapters.ResolveMacros(usersyncURL+url.QueryEscape(externalURL)), adapters.SyncTypeRedirect)
}
5 changes: 3 additions & 2 deletions adapters/adkernelAdn/usersync_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package adkernelAdn

import (
"strings"
"testing"

"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/openrtb_ext"

"github.com/stretchr/testify/assert"
)

func TestAdkernelAdnSyncer(t *testing.T) {
syncer := NewAdkernelAdnSyncer(&config.Configuration{ExternalURL: "https://localhost:8888", Adapters: map[string]config.Adapter{
string(openrtb_ext.BidderAdkernelAdn): {
// Prevents #736
strings.ToLower(string(openrtb_ext.BidderAdkernelAdn)): {
UserSyncURL: "https://tag.adkernel.com/syncr?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&r=",
},
}})
Expand Down

0 comments on commit 1a74919

Please sign in to comment.