Skip to content

Commit

Permalink
Fix inf loop (prebid#7460)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlb7687 authored and Chris Pabst committed Jan 10, 2022
1 parent 64b0cfd commit f17ed8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {

let currentImpressionSize = encodeURIComponent(JSON.stringify({ impressionObjects })).length;

while (currentImpressionSize > remainingRequestSize) {
while (impressionObjects.length && currentImpressionSize > remainingRequestSize) {
wasAdUnitImpressionsTrimmed = true;
impressionObjects.pop();
currentImpressionSize = encodeURIComponent(JSON.stringify({ impressionObjects })).length;
Expand Down

0 comments on commit f17ed8e

Please sign in to comment.