HTTP 리디렉션이 발생하면 Chrome이 교차 원점 AJAX 요청을 취소하는 신비한 문제가 있습니다. 네트워크 탭에서 "(취소됨)"으로 표시되며 응답 헤더 또는 본문을 사용할 수 없습니다.리디렉션시 Chrome에서 CORS XHR을 취소합니다.
- 로드 페이지 HTTP에 :
여기 흐름이다 //
- POST 요청은 HTTPS에 엔드 포인트 로그인 : //
- 303 응답 취소
- 요청.
var r = new XMLHttpRequest(); r.open('POST', 'https://dev.example.com/appName-rest/login', true); r.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); r.send(JSON.stringify({"username":"myusername","password":"myrealpassword"})); r.send();
크롬의 순 내부 서버가이 헤더로 응답 하였음을 보여줍니다 : 여기
이 (ajaxtest.html
에서)이 JS의
HTTP/1.1 303 See Other
Date: Thu, 05 Sep 2013 17:54:21 GMT
Server: Apache/2
Access-Control-Allow-Origin: http://dev.example.com
Access-Control-Allow-Credentials: true
Location: https://dev.example.com/appName-rest/j_spring_cas_security_check?ticket=xxxx.example.com
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 52
Connection: close
Content-Type: text/plain; charset=UTF-8
그리고는 말한다 : URL_REQUEST_BLOCKED_ON_DELEGATE
합니까 왜 이것이 실패하고 있는지 아는 사람이 있습니까?
WebService를 사용하고 있습니까? – PabloWeb18
잘 모르겠다. 나는 그렇게 생각한다. 그러나 코드는 단순한 자바 스크립트입니다. –