diff --git a/pkg/modules/update_bundle/module/hook_raw_bidder_response.go b/pkg/modules/update_bundle/module/hook_raw_bidder_response.go index 1af8afd83a6..c1ddbd411ae 100644 --- a/pkg/modules/update_bundle/module/hook_raw_bidder_response.go +++ b/pkg/modules/update_bundle/module/hook_raw_bidder_response.go @@ -4,6 +4,7 @@ import ( "strings" "github.com/prebid/prebid-server/hooks/hookstage" + u "github.com/rjNemo/underscore" ) func handleRawBidderResponsesHook( @@ -11,6 +12,23 @@ func handleRawBidderResponsesHook( context hookstage.ModuleInvocationContext, ) (result hookstage.HookResult[hookstage.RawBidderResponsePayload], err error) { + shouldBlock := true + + if miCtxData, found := context.ModuleContext[MSP_UPDATE_BUNDLE_EXPS]; found { + pmExps := miCtxData.([]string) + if u.Contains(pmExps, "enable_state_farm_true") { + shouldBlock = false + } + } + if shouldBlock { + for _, bid := range payload.Bids { + if bid.Bid != nil && u.Contains(bid.Bid.ADomain, "statefarm.com") { + result.Reject = true + return result, nil + } + } + } + placementId := "" if data, ok := context.ModuleContext[MSP_UPDATE_BUNDLE_PLACEMENT]; ok { placementId = data.(string)