2014-09-22 4 views
2

이 문제는 PlayStation 3, 4, Xbox360, Xbox One에서 재현되었습니다. 이 문제는 모든 버전의 AjaxPro에서 발생합니다.특정 브라우저의 AjaxPro에서 ConnectFailure

(AjaxPro를 사용하여) Ajax 요청을하면 서버는 올바른 내용을 리턴합니다. 그러나 개체가 콜백 기능에 반환

{ 
    "error": 
    { 
    "Message":"","Type":"ConnectFailure","Status":200},"value":null, 
    "request": 
    { 
     "method":"MethodName", 
     "args": 
     { 
      "Argument1":"1111","Argument2":"2222" 
     } 
    }, 
    "context":null,"duration":18 
    } 
} 

답변

4

필자는 AjaxPro를 https, TLS 1.2, ECDHE_RSA와 P-256 키 교환 및 AES_256_GCM 암호 (IE11 +, Chrome51 +, Firefox49 +.)를 사용하는 경우에도 동일한 오류가 발생합니다. here을 확인하십시오. 그것은 HMAC-SHA1 암호로 오래된 AES_256_CBC를 사용하여 ok로 실행됩니다.

문제는 XMLHttpRequest.statusText 속성 (난 정말 이유를 알고하지 않습니다) 서버 응답 후 비어 있고 AjaxPro.Request.prototype.doStateChange 방법 (ajaxpro/core.ashx 파일) "OK"예상이다 유효한 것으로 응답을 촬영 : 나는 마침내 AjaxPro.Request.prototype.doStateChange 메소드를 오버라이드 (override) this.xmlHttp.statusText에서 빈 값을 허용하기로 결정

var res = this.getEmptyRes(); 
if(this.xmlHttp.status == 200 && this.xmlHttp.statusText == "OK") { 
    res = this.createResponse(res); 
} else { 
    res = this.createResponse(res, true); 
    res.error = {Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status}; 
} 

.

은 내 영향을받는 페이지에이 스크립트를 추가 :

$(function() { 
    if (typeof AjaxPro != 'undefined' && AjaxPro && AjaxPro.Request && AjaxPro.Request.prototype) { 
     AjaxPro.Request.prototype.doStateChange = function() { 
      this.onStateChanged(this.xmlHttp.readyState, this); 
      if (this.xmlHttp.readyState != 4 || !this.isRunning) { 
       return; 
      } 
      this.duration = new Date().getTime() - this.__start; 
      if (this.timeoutTimer != null) { 
       clearTimeout(this.timeoutTimer); 
      } 
      var res = this.getEmptyRes(); 
      if (this.xmlHttp.status == 200 && (this.xmlHttp.statusText == "OK" || !this.xmlHttp.statusText)) { 
       res = this.createResponse(res); 
      } else { 
       res = this.createResponse(res, true); 
       res.error = { Message: this.xmlHttp.statusText, Type: "ConnectFailure", Status: this.xmlHttp.status }; 
      } 
      this.endRequest(res); 
     }; 
    } 
}); 
+0

감사합니다 해결 방법을 제공. –

0

이다이 문제에 대한 힌트

"Message":"" 

AjaxPro의 core.ashx 파일을 core.js 핵심에서

를 사용하여 생성된다 .js의 경우 다음 코드는 서버의 응답을받을 때 응답 객체를 생성합니다. 어떤 이유
if (this.xmlHttp.status == 200 && this.xmlHttp.statusText == "OK") { 
     res = this.createResponse(res); 
    } else { 
     res = this.createResponse(res, true); 
     res.error = { Message: this.xmlHttp.statusText, Type: "ConnectFailure", Status: this.xmlHttp.status }; 
    } 

은 식별 플랫폼의 브라우저는 "OK"로 xmlHttp.statusText 반환하지 않습니다. 대신 그것은 비어 있습니다. 이로 인해 AjaxPro가 "ConnectionFailure"절로 빠지게됩니다.