Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"XHR open failed." in BOSH in IE9 with v1.2.8 #125

Open
wk3368 opened this issue Oct 23, 2016 · 0 comments
Open

"XHR open failed." in BOSH in IE9 with v1.2.8 #125

wk3368 opened this issue Oct 23, 2016 · 0 comments

Comments

@wk3368
Copy link

wk3368 commented Oct 23, 2016

LOG: 23:30:52:123 0 _throttledRequestHandler called with 1 requests 
LOG: 23:30:52:125 0 request id 1.0 posting 
LOG: 23:30:52:126 3 XHR open failed. 

but v1.2.2 works fine .

I have compared the code between v1.2.2 and v1.2.8

v1.2.2

try {
    req.xhr.open("POST", this._conn.service, this._conn.options.sync ? false : true);
    req.xhr.setRequestHeader && req.xhr.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
}

v1.2.8

try {
    var contentType = this._conn.options.contentType || "text/xml; charset=utf-8";    
    req.xhr.open("POST", this._conn.service, this._conn.options.sync ? false : true);    
    req.xhr.setRequestHeader("Content-Type", contentType);    
    if (this._conn.options.withCredentials) {
        req.xhr.withCredentials = true;
    }
}

so I try to change this line in v1.2.8:

 req.xhr.setRequestHeader("Content-Type", contentType); 

to

req.xhr.setRequestHeader && req.xhr.setRequestHeader("Content-Type", contentType); 

and it works fine!

I think this is a bug!

wytheme added a commit to easemob/web-im that referenced this issue Oct 25, 2016
* dev:
  change ts() to Demo.api.ts()  ,if  isDebug=false there should not be error while debug.js is not include
  add CHANGELOG.md
  strophe.js v1.2.8有bug,IE9连BOSH协议,会报错:XHR open failed.  参照v1.2.2修改了! metajack/strophejs#125
  update doc
  断线重连: 重新整理相关调用的逻辑 strophe.js 之前重载的几个函数不需要重载了!
  webim.config.js:  add autoReconnectNumMax  and autoReconnectInterval
  断线重连: onError: WEBIM_CONNCTION_SERVER_ERROR type=8 自动重连ok
  optimizing
  add TODO
  add doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant