<i id='FV6cG'><tr id='FV6cG'><dt id='FV6cG'><q id='FV6cG'><span id='FV6cG'><b id='FV6cG'><form id='FV6cG'><ins id='FV6cG'></ins><ul id='FV6cG'></ul><sub id='FV6cG'></sub></form><legend id='FV6cG'></legend><bdo id='FV6cG'><pre id='FV6cG'><center id='FV6cG'></center></pre></bdo></b><th id='FV6cG'></th></span></q></dt></tr></i><div id='FV6cG'><tfoot id='FV6cG'></tfoot><dl id='FV6cG'><fieldset id='FV6cG'></fieldset></dl></div>

<small id='FV6cG'></small><noframes id='FV6cG'>

        <bdo id='FV6cG'></bdo><ul id='FV6cG'></ul>

      1. <tfoot id='FV6cG'></tfoot>
      2. <legend id='FV6cG'><style id='FV6cG'><dir id='FV6cG'><q id='FV6cG'></q></dir></style></legend>

        尽管有标头,Firefox '跨源请求被阻止'

        时间:2023-09-03
        <i id='YGSKG'><tr id='YGSKG'><dt id='YGSKG'><q id='YGSKG'><span id='YGSKG'><b id='YGSKG'><form id='YGSKG'><ins id='YGSKG'></ins><ul id='YGSKG'></ul><sub id='YGSKG'></sub></form><legend id='YGSKG'></legend><bdo id='YGSKG'><pre id='YGSKG'><center id='YGSKG'></center></pre></bdo></b><th id='YGSKG'></th></span></q></dt></tr></i><div id='YGSKG'><tfoot id='YGSKG'></tfoot><dl id='YGSKG'><fieldset id='YGSKG'></fieldset></dl></div>
          <bdo id='YGSKG'></bdo><ul id='YGSKG'></ul>
        • <tfoot id='YGSKG'></tfoot>
          <legend id='YGSKG'><style id='YGSKG'><dir id='YGSKG'><q id='YGSKG'></q></dir></style></legend>
            <tbody id='YGSKG'></tbody>

                <small id='YGSKG'></small><noframes id='YGSKG'>

                  本文介绍了尽管有标头,Firefox '跨源请求被阻止'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试发出一个简单的跨域请求,而 Firefox 一直以这个错误阻止它:

                  I'm trying to make a simple cross-origin request, and Firefox is consistently blocking it with this error:

                  跨域请求被阻止:同源策略不允许读取 [url] 处的远程资源.这可以通过将资源移动到同一域或启用 CORS 来解决.[网址]

                  Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [url]. This can be fixed by moving the resource to the same domain or enabling CORS. [url]

                  它在 Chrome 和 Safari 中运行良好.

                  It works fine in Chrome and Safari.

                  据我所知,我已经在我的 PHP 上设置了所有正确的标头以允许它工作.这是我的服务器响应的内容

                  As far as I can tell I've set all the correct headers on my PHP to allow this to work. Here's what my server is responding with

                  HTTP/1.1 200 OK
                  Date: Mon, 23 Jun 2014 17:15:20 GMT
                  Server: Apache/2.2.22 (Debian)
                  X-Powered-By: PHP/5.4.4-14+deb7u8
                  Access-Control-Allow-Origin: *
                  Access-Control-Allow-Methods: GET, POST, OPTIONS
                  Access-Control-Allow-Headers: Content-Type
                  Access-Control-Request-Headers: X-Requested-With, accept, content-type
                  Vary: Accept-Encoding
                  Content-Length: 186
                  Content-Type: text/html
                  

                  我尝试过使用 Angular、jQuery 和一个基本的 XMLHTTPRequest 对象,如下所示:

                  I've tried using Angular, jQuery, and a basic XMLHTTPRequest object, like so:

                  var data = "id=1234"
                  var request = new XMLHttpRequest({mozSystem: true})
                  request.onload = onSuccess;
                  request.open('GET', 'https://myurl.com' + '?' + data, true)
                  request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
                  request.send()
                  

                  ...它适用于除 Firefox 之外的所有浏览器.有人可以帮忙吗?

                  ...and it works in every browser except Firefox. Can anyone help with this?

                  推荐答案

                  原来这与 CORS 无关——这是安全证书的问题.误导性错误 = 4 小时的头痛.

                  Turns out this has nothing to do with CORS- it was a problem with the security certificate. Misleading errors = 4 hours of headaches.

                  这篇关于尽管有标头,Firefox '跨源请求被阻止'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:同一域上的CORS错误? 下一篇:API Gateway CORS:没有“Access-Control-Allow-Origin"标头

                  相关文章

                  最新文章

                  <legend id='875Am'><style id='875Am'><dir id='875Am'><q id='875Am'></q></dir></style></legend>

                • <tfoot id='875Am'></tfoot>
                • <small id='875Am'></small><noframes id='875Am'>

                    <i id='875Am'><tr id='875Am'><dt id='875Am'><q id='875Am'><span id='875Am'><b id='875Am'><form id='875Am'><ins id='875Am'></ins><ul id='875Am'></ul><sub id='875Am'></sub></form><legend id='875Am'></legend><bdo id='875Am'><pre id='875Am'><center id='875Am'></center></pre></bdo></b><th id='875Am'></th></span></q></dt></tr></i><div id='875Am'><tfoot id='875Am'></tfoot><dl id='875Am'><fieldset id='875Am'></fieldset></dl></div>
                      <bdo id='875Am'></bdo><ul id='875Am'></ul>