Prebid.js
Prebid.js copied to clipboard
ad units mutated by bid requests
Type of issue
Bug
Description
The pbjs.adUnits are passed by reference or Object.assign'd at some point resulting in mutation of the ad unit objects to include properties of bid request objects. I don't believe this would have any ill effects but is not expected and somewhat astonishing.
Steps to reproduce
- Load a test page with a break point set on
pbjs.requestBids - View contents of
pbjs.adUnits - Continue code execution for
pbjs.requestBids - View contents of
pbjs.adUnitsagain
Expected results
The ad units array before a request for bids should match the array afterwards.
Actual results
The ad units contains properties of bid requests.
# Before `requestBids`
{
"code": "/12345/header-bid-tag-4",
"sizes": [
300,
250
],
"bids": [
{
"bidder": "appnexusAst",
"params": {
"placementId": "4799418",
"dealId": "some deal!"
}
}
]
}
# After `requestBids`
{
"code": "/12345/header-bid-tag-4",
"sizes": [
300,
250
],
"bids": [
{
"bidder": "appnexusAst",
"params": {
"placementId": "4799418",
"dealId": "some deal!"
},
"placementCode": "/19968336/header-bid-tag-4",
"sizes": [
300,
250
],
"bidId": "10cc3c57380433f",
"bidderRequestId": "9c2604bca503d2",
"requestId": "46e4084e-547f-4ea7-998a-6dbf50cf28a9"
}
]
}
Fixed in #1019