<bdo id='5k0xp'></bdo><ul id='5k0xp'></ul>
    <tfoot id='5k0xp'></tfoot>

    <small id='5k0xp'></small><noframes id='5k0xp'>

    1. <legend id='5k0xp'><style id='5k0xp'><dir id='5k0xp'><q id='5k0xp'></q></dir></style></legend>
      <i id='5k0xp'><tr id='5k0xp'><dt id='5k0xp'><q id='5k0xp'><span id='5k0xp'><b id='5k0xp'><form id='5k0xp'><ins id='5k0xp'></ins><ul id='5k0xp'></ul><sub id='5k0xp'></sub></form><legend id='5k0xp'></legend><bdo id='5k0xp'><pre id='5k0xp'><center id='5k0xp'></center></pre></bdo></b><th id='5k0xp'></th></span></q></dt></tr></i><div id='5k0xp'><tfoot id='5k0xp'></tfoot><dl id='5k0xp'><fieldset id='5k0xp'></fieldset></dl></div>
      1. 禁止预检 403 响应

        时间:2023-10-14

        • <bdo id='Z2RGy'></bdo><ul id='Z2RGy'></ul>
        • <small id='Z2RGy'></small><noframes id='Z2RGy'>

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

              1. <tfoot id='Z2RGy'></tfoot>
                  <tbody id='Z2RGy'></tbody>

                  本文介绍了禁止预检 403 响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我一直在尝试向服务器发送一个简单的 iron-ajax 帖子,但它在预检调用中一直失败.对于我的生活,我无法弄清楚发生了什么,服务器上的所有 CORS 标头似乎都是正确的.

                  I've been trying to make a simple iron-ajax post to the server, but it keeps failing at the preflight call. For the life of me I can't figure out what's going on, all the CORS headers seem to be correct on the server.

                  响应头

                  Access-Control-Allow-Credentials:true
                  Access-Control-Allow-Headers:Content-Type
                  Access-Control-Allow-Methods:GET, POST, PUT, OPTIONS
                  Access-Control-Allow-Origin:*
                  cache-control:must-revalidate, private, no-cache, no-store, max-age=0
                  Connection:Keep-Alive
                  Content-Encoding:gzip
                  Content-Length:138
                  Content-Type:text/html
                  

                  请求标头

                  Accept:*/*
                  Accept-Encoding:gzip, deflate, sdch, br
                  Accept-Language:en-US,en;q=0.8
                  Access-Control-Request-Headers:content-type
                  Access-Control-Request-Method:POST
                  Cache-Control:no-cache
                  Connection:keep-alive
                  

                  请求确实是从 localhost 发出的,但我原以为 * 应该处理这个问题.

                  The request is indeed made from localhost, but I would have thought that the * should take care of that.

                  控制台中显示的错误是:OPTIONS https://... 403(禁止)

                  Errors that are showing up in the console are: OPTIONS https://... 403 (Forbidden) and

                  XMLHttpRequest cannot load https://.... Response for preflight has invalid HTTP status code 403
                  

                  感谢任何帮助/建议.

                  推荐答案

                  403 响应状态表示服务器后端未配置为处理 OPTIONS 请求的一般问题,而不仅仅是 CORS 预检 OPTIONS 请求.

                  The 403 response status indicates a general problem with the server backend not being configured to handle OPTIONS requests, not just CORS preflight OPTIONS requests.

                  服务器必须以 2xx 成功状态(通常为 200 或 204)响应 OPTIONS 请求.

                  The server must respond to OPTIONS requests with a 2xx success status—typically 200 or 204.

                  如果服务器不这样做,那么您将其配置为发送什么 Access-Control-* 标头没有任何区别.配置它以正确方式处理 OPTIONS 请求(发送 200 或 204 成功消息)的答案取决于它运行的服务器软件.

                  If the server doesn’t do that, it makes no difference what Access-Control-* headers you have it configured to send. And the answer to configuring it to handle OPTIONS requests in the right way — to send a 200 or 204 success message — depends on what server software it’s running.

                  这篇关于禁止预检 403 响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Javascript CORS - 不存在“Access-Control-Allow-Origin&quo 下一篇:HTTP 预检 (OPTIONS) 请求仅在 IE 中失败

                  相关文章

                  最新文章

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

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

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