Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Incorrect XDomainUsage.send invocation

Open ckbo3hrk opened this issue 8 years ago • 0 comments

Type of issue

Bug

Description

It seems that XDomainRequest.send is sensitive to incorrect input parameter value:

https://github.com/prebid/Prebid.js/blob/377c4c21f0e922c0549c3deaea327928bece3b12/src/ajax.js#L101 ... as it fails when method = 'GET'

Steps to reproduce

  1. Open IE9
  2. Execute:
var x = new window.XDomainRequest();
var method = 'GET';
var data = undefined;
var url = 'http://cpm.metaadserving.com/rtbg?zone=30164&ad_type=rtb&v=1.0&r=%7B%22id%22%3A%223a0006d5423757%22%2C%22imp%22%3A%5B%7B%22id%22%3A%2243b4631d9943f3%22%2C%22tagid%22%3A%22container-1%22%2C%22banner%22%3A%7B%22w%22%3A300%2C%22h%22%3A250%7D%7D%5D%2C%22site%22%3A%7B%22domain%22%3A%22prebidjs.com%22%2C%22page%22%3A%22http%3A%2F%2Fprebidjs.com%2Fa.html%22%7D%2C%22at%22%3A1%2C%22device%22%3A%7B%22ip%22%3A%22caller%22%2C%22ua%22%3A%22caller%22%7D%7D&';
x.open(method, url)
x.send(method === 'POST' && data);

Test page

https://jsfiddle.net/ckbo3hrk/c3ag20s3/

Expected results

Network request to cpm.metaadserving.com/rtbg is issued

Actual results

Exception is thrown

Platform details

IE9 emulation in IE11, PB version 1.0.0,

ckbo3hrk avatar Dec 08 '17 09:12 ckbo3hrk