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

    1. <small id='KgGce'></small><noframes id='KgGce'>

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

        <tfoot id='KgGce'></tfoot>
        <legend id='KgGce'><style id='KgGce'><dir id='KgGce'><q id='KgGce'></q></dir></style></legend>

        禁止预检 403 响应

        Response for preflight 403 forbidden(禁止预检 403 响应)
          <bdo id='ENIiv'></bdo><ul id='ENIiv'></ul>
              <tbody id='ENIiv'></tbody>
          1. <tfoot id='ENIiv'></tfoot>

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

            <legend id='ENIiv'><style id='ENIiv'><dir id='ENIiv'><q id='ENIiv'></q></dir></style></legend>
            • <i id='ENIiv'><tr id='ENIiv'><dt id='ENIiv'><q id='ENIiv'><span id='ENIiv'><b id='ENIiv'><form id='ENIiv'><ins id='ENIiv'></ins><ul id='ENIiv'></ul><sub id='ENIiv'></sub></form><legend id='ENIiv'></legend><bdo id='ENIiv'><pre id='ENIiv'><center id='ENIiv'></center></pre></bdo></b><th id='ENIiv'></th></span></q></dt></tr></i><div id='ENIiv'><tfoot id='ENIiv'></tfoot><dl id='ENIiv'><fieldset id='ENIiv'></fieldset></dl></div>
                  本文介绍了禁止预检 403 响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我一直在尝试向服务器发送一个简单的 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 响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Show a progress bar for downloading files using XHR2/AJAX(显示使用 XHR2/AJAX 下载文件的进度条)
                  How do I get the HTTP status code with jQuery?(如何使用 jQuery 获取 HTTP 状态码?)
                  How to get response url in XMLHttpRequest?(如何在 XMLHttpRequest 中获取响应 url?)
                  WebKit quot;Refused to set unsafe header #39;content-length#39;quot;(WebKit “拒绝设置不安全的标头‘内容长度’)
                  $.ajax call working fine in IE8 and Doesn#39;t work in firefox and chrome browsers($.ajax 调用在 IE8 中运行良好,但在 Firefox 和 chrome 浏览器中不起作用)
                  How do I know if jQuery has an Ajax request pending?(我如何知道 jQuery 是否有待处理的 Ajax 请求?)
                  <legend id='9tqMp'><style id='9tqMp'><dir id='9tqMp'><q id='9tqMp'></q></dir></style></legend>
                1. <small id='9tqMp'></small><noframes id='9tqMp'>

                    <bdo id='9tqMp'></bdo><ul id='9tqMp'></ul>

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