gpt4 book ai didi

google-chrome - HTTP 选项飞行前请求加载已取消,Chrome 中处于待处理状态

转载 作者:行者123 更新时间:2023-12-04 15:46:00 25 4
gpt4 key购买 nike

我正在使用 Sencha Touch 2.1.0。我正在进行 HTTP GET 调用。这是一个 CORS 请求。因此,它按预期发送飞行前 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

同样的请求给了我来自 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

Store 中的 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,

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

最佳答案

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

关于google-chrome - HTTP 选项飞行前请求加载已取消,Chrome 中处于待处理状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14351437/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com