File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed
Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -335,14 +335,17 @@ export const spec = {
335335 const baseUrl = getEndpoint ( data . ext . network ) ;
336336 const fullUrl = `${ baseUrl } ?data=${ encodeURIComponent ( jsonData ) } ` ;
337337
338+ // adbeta needs credentials omitted to avoid CORS issues, especially in Firefox
339+ const useCredentials = ! ( ! ! data . ext ?. adbeta ) ;
340+
338341 // Switch to POST if URL exceeds 8k characters
339342 if ( fullUrl . length > 8192 ) {
340343 return {
341344 method : 'POST' ,
342345 url : baseUrl ,
343346 data : jsonData ,
344347 options : {
345- withCredentials : true ,
348+ withCredentials : useCredentials ,
346349 crossOrigin : true ,
347350 customHeaders : {
348351 'Content-Type' : 'text/plain'
@@ -355,7 +358,7 @@ export const spec = {
355358 method : 'GET' ,
356359 url : fullUrl ,
357360 options : {
358- withCredentials : true ,
361+ withCredentials : useCredentials ,
359362 crossOrigin : true ,
360363 } ,
361364 } ;
Original file line number Diff line number Diff line change @@ -265,6 +265,35 @@ describe('dasBidAdapter', function () {
265265 expect ( payload . ext . network ) . to . equal ( 'network1' ) ;
266266 } ) ;
267267
268+ it ( 'should set withCredentials to false when adbeta flag is present' , function ( ) {
269+ const bidRequestsWithAdbeta = [ {
270+ bidId : 'bid123' ,
271+ params : {
272+ site : 'site1' ,
273+ area : 'area1' ,
274+ slot : 'slot1' ,
275+ network : 'network1' ,
276+ adbeta : 'l1021885!slot.nativestd' ,
277+ pageContext : { }
278+ } ,
279+ mediaTypes : {
280+ banner : {
281+ sizes : [ [ 300 , 250 ] ]
282+ }
283+ }
284+ } ] ;
285+
286+ const bidderRequestWithAdbeta = {
287+ bidderRequestId : 'reqId123' ,
288+ ortb2 : { } ,
289+ adbeta : true
290+ } ;
291+
292+ const request = spec . buildRequests ( bidRequestsWithAdbeta , bidderRequestWithAdbeta ) ;
293+
294+ expect ( request . options . withCredentials ) . to . be . false ;
295+ } ) ;
296+
268297 describe ( 'interpretResponse' , function ( ) {
269298 const serverResponse = {
270299 body : {
You can’t perform that action at this time.
0 commit comments