File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,15 @@ export const spec = {
94
94
* @return boolean True if this is a valid bid, and false otherwise.
95
95
*/
96
96
isBidRequestValid : function ( bid ) {
97
- if ( bid . params && bid . params ) {
97
+ // siteId is required
98
+ if ( bid . params && bid . params . siteId ) {
99
+ // it must be a string
98
100
if ( ! utils . isStr ( bid . params . siteId ) ) {
99
101
_logWarn ( 'siteId is required for bid' , bid ) ;
100
102
return false ;
101
103
}
104
+ } else {
105
+ return false ;
102
106
}
103
107
104
108
return true ;
Original file line number Diff line number Diff line change @@ -496,30 +496,29 @@ describe('PubWiseAdapter', function () {
496
496
bidder : 'pubwise' ,
497
497
params : {
498
498
siteId : 'xxxxxx' ,
499
- placeHolder : ''
499
+ gender : 'M' ,
500
500
}
501
501
} ,
502
502
isValid = spec . isBidRequestValid ( validBid ) ;
503
503
expect ( isValid ) . to . equal ( true ) ;
504
504
} ) ;
505
505
506
506
it ( 'invalid bid: no siteId' , function ( ) {
507
- let validBid = {
507
+ let inValidBid = {
508
508
bidder : 'pubwise' ,
509
509
params : {
510
- placeHolder : ''
510
+ gender : 'M' ,
511
511
}
512
512
} ,
513
- isValid = spec . isBidRequestValid ( validBid ) ;
513
+ isValid = spec . isBidRequestValid ( inValidBid ) ;
514
514
expect ( isValid ) . to . equal ( false ) ;
515
515
} ) ;
516
516
517
- it ( 'invalid bid: siteId shuold be a sring ' , function ( ) {
517
+ it ( 'invalid bid: siteId should be a string ' , function ( ) {
518
518
let validBid = {
519
519
bidder : 'pubwise' ,
520
520
params : {
521
- publisherId : 100000 ,
522
- placeHolder : ''
521
+ siteId : 123456
523
522
}
524
523
} ,
525
524
isValid = spec . isBidRequestValid ( validBid ) ;
@@ -530,7 +529,7 @@ describe('PubWiseAdapter', function () {
530
529
describe ( 'Handling Request Construction' , function ( ) {
531
530
it ( 'bid requests are not mutable' , function ( ) {
532
531
let sourceBidRequest = utils . deepClone ( sampleValidBidRequests )
533
- let request = spec . buildRequests ( sampleValidBidRequests , { auctinId : 'placeholder' } ) ;
532
+ spec . buildRequests ( sampleValidBidRequests , { auctinId : 'placeholder' } ) ;
534
533
expect ( sampleValidBidRequests ) . to . deep . equal ( sourceBidRequest , 'Should be unedited as they are used elsewhere' ) ;
535
534
} ) ;
536
535
it ( 'should handle complex bidRequest' , function ( ) {
You can’t perform that action at this time.
0 commit comments