HTTP选项转发前请求已加载已取消,Chrome中有待处理状态

Vee*_*ndi 6 google-chrome cors http-options-method sencha-touch-2

我正在使用Sencha Touch 2.1.0.我正在进行HTTP GET调用.这是一个CORS请求.因此它正在按预期发送Pre-flight HTTP OPTIONS命令.

我在我的服务器上安装了CORS过滤器并进行了配置.来自我的代码的电话一直很顺利,直到昨天.突然间它今天停止加载数据.当我在Chrome中查看网络电话时,我发现OPTIONS方法显示为"已取消加载"

方法:选项
状态文本:"加载取消"
类型:待定
启动器:Connection.js:319

我第一次配置CORS过滤器时遇到了类似的问题.当我清除浏览器缓存时,它开始工作.这一次,我不确定它为什么突然停止工作.即使我在浏览器中清除缓存和历史记录,也无法修复.

如果我在Firefox中使用HTTPRequestor进行同样的调用,那么它的效果非常好.这是电话.由于保密原因,我屏蔽了网址.

OPTIONS http://myurl/rest/items?_dc=1358304888220&page=1&start=0&limit=25 HTTP/1.1
Access-Control-Request-Method: GET
Origin: http://localhost:8080
Access-Control-Request-Headers: accept, origin, x-requested-with
Run Code Online (Sandbox Code Playgroud)

同样的确切请求给了我一个非常好的HTTPRequestor响应.结果如下:

OPTIONS http://myurl/rest/items?_dc=1358304888220&page=1&start=0&limit=25
Access-Control-Request-Headers: accept, origin, x-requested-with
Access-Control-Request-Method: GET
Origin: http://localhost:8080


 -- response --
200 OK
Date:  Wed, 16 Jan 2013 03:19:27 GMT

Server:  Apache-Coyote/1.1

Access-Control-Allow-Origin:  http://localhost:8080

Access-Control-Allow-Credentials:  true

Access-Control-Allow-Methods:  HEAD, GET, POST, OPTIONS

Access-Control-Allow-Headers:  X-Requested-With, Origin, Accept, Content-Type

Content-Length:  0

Strict-Transport-Security:  max-age=15768000, includeSubDomains

Keep-Alive:  timeout=15, max=100

Connection:  Keep-Alive
Run Code Online (Sandbox Code Playgroud)

在商店中使用Sencha代码进行此调用:

    proxy: {
        type: 'ajax',
        method: 'GET',
        url: 'http://myurl/rest/items',
        withCredentials: true,
        useDefaultXhrHeader: false,
        disableCaching: false,
        headers: {
            "Accept": "application/json"
        },
        failure: function(response) {
            if (response.timedout) {
                Ext.Msg.alert('Timeout', "The server timed out :(");
            } else if (response.aborted) {
                Ext.Msg.alert('Aborted', "Looks like you aborted the request");
            } else {
                Ext.Msg.alert('Bad', "Something went wrong with your request");
            }
        },
        success: function(response){
            Ext.Msg.alert(response.responseText);
        }
    },
    autoLoad: true,
Run Code Online (Sandbox Code Playgroud)

请帮助我了解如何解决此问题.

Vee*_*ndi 2

这似乎是由于上次 Google Chrome 更新造成的问题。当我尝试使用 Iron 浏览器时,它可以工作。