From b927d8d21628c42cbbfc6bfac8823528f53a25da Mon Sep 17 00:00:00 2001 From: Jorge Rocha Date: Mon, 15 Nov 2021 04:18:36 -0500 Subject: [PATCH] Prebid Core: Restore use of server-side adapter without client-side adapter (#7662) * requestBids bug fix for s2sBidders and getConfig * merged duplicate variables in requestBids --- src/prebid.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/prebid.js b/src/prebid.js index 855d53d7de0..5dec6b86336 100644 --- a/src/prebid.js +++ b/src/prebid.js @@ -554,13 +554,12 @@ $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeo logInfo('Invoking $$PREBID_GLOBAL$$.requestBids', arguments); - let _s2sConfigs = []; const s2sBidders = []; - config.getConfig('s2sConfig', config => { - if (config && config.s2sConfig) { - _s2sConfigs = Array.isArray(config.s2sConfig) ? config.s2sConfig : [config.s2sConfig]; - } - }); + let _s2sConfigs = config.getConfig('s2sConfig') || []; + + if (!Array.isArray(_s2sConfigs)) { + _s2sConfigs = [_s2sConfigs]; + } _s2sConfigs.forEach(s2sConfig => { s2sBidders.push(...s2sConfig.bidders);