• <small id='gG3bH'></small><noframes id='gG3bH'>

    <tfoot id='gG3bH'></tfoot>

    • <bdo id='gG3bH'></bdo><ul id='gG3bH'></ul>

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

        AMP 访问控制允许 Source Origin 标头问题

        AMP Access Control Allow Source Origin header Issue(AMP 访问控制允许 Source Origin 标头问题)

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

            <tbody id='oOfIq'></tbody>
          1. <legend id='oOfIq'><style id='oOfIq'><dir id='oOfIq'><q id='oOfIq'></q></dir></style></legend>
          2. <tfoot id='oOfIq'></tfoot>
                <bdo id='oOfIq'></bdo><ul id='oOfIq'></ul>
              • <i id='oOfIq'><tr id='oOfIq'><dt id='oOfIq'><q id='oOfIq'><span id='oOfIq'><b id='oOfIq'><form id='oOfIq'><ins id='oOfIq'></ins><ul id='oOfIq'></ul><sub id='oOfIq'></sub></form><legend id='oOfIq'></legend><bdo id='oOfIq'><pre id='oOfIq'><center id='oOfIq'></center></pre></bdo></b><th id='oOfIq'></th></span></q></dt></tr></i><div id='oOfIq'><tfoot id='oOfIq'></tfoot><dl id='oOfIq'><fieldset id='oOfIq'></fieldset></dl></div>
                • 本文介绍了AMP 访问控制允许 Source Origin 标头问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何解决以下错误;

                  <块引用>

                  加载资源失败:服务器响应状态为 500(内部服务器错误)cdn.ampproject.org/v0.js:68 响应必须包含 AMP-Access-Control-Allow-Source-Origin 标头码@cdn.ampproject.org/v0.js:68cdn.ampproject.org/v0.js:68 表单提交失败:错误:响应必须包含 AMP-Access-Control-Allow-Source-Origin 标头 reported

                  遵循

                  解决方案

                  请尝试以下代码

                  if(!empty($_POST)){$domain_url = (isset($_SERVER['HTTPS']) ? "https" : "http") ."://$_SERVER[HTTP_HOST]";header("内容类型:应用程序/json");header("Access-Control-Allow-Credentials: true");header("Access-Control-Allow-Origin: ".str_replace('.', '-','https://example.com') .".cdn.ampproject.org");header("AMP-Access-Control-Allow-Source-Origin: " . $domain_url);header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin");header("AMP-Redirect-To: https://example.com/thankyou.amp.html");header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-Allow-Source-Origin");echo json_encode(array('successmsg'=>'data post'));出口;}

                  <块引用>

                  请确保域 url 应该是 https

                  将 https://example.com/ 替换为您想要的网址

                  How can I resolve the error below;

                  Failed to load resource: the server responded with a status of 500 (Internal Server Error) cdn.ampproject.org/v0.js:68 Response must contain the AMP-Access-Control-Allow-Source-Origin header Yd @ cdn.ampproject.org/v0.js:68 cdn.ampproject.org/v0.js:68 Form submission failed: Error: Response must contain the AMP-Access-Control-Allow-Source-Origin header reported

                  Followed all instructions at the AMP GitHub Page on CORS.

                  Below is a screenshot of my PHP code at the server side and error in the console of my browser;

                  解决方案

                  Please try with following code

                  if(!empty($_POST)){
                          $domain_url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
                          header("Content-type: application/json");
                          header("Access-Control-Allow-Credentials: true");
                          header("Access-Control-Allow-Origin: ". str_replace('.', '-','https://example.com') .".cdn.ampproject.org");
                          header("AMP-Access-Control-Allow-Source-Origin: " . $domain_url);
                          header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin");
                          header("AMP-Redirect-To: https://example.com/thankyou.amp.html");
                          header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-Allow-Source-Origin"); 
                          echo json_encode(array('successmsg'=>'data post'));
                          exit;
                  }
                  

                  Please make sure that domain url should be https

                  Replace https://example.com/ to your desired url

                  这篇关于AMP 访问控制允许 Source Origin 标头问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <legend id='hxfXb'><style id='hxfXb'><dir id='hxfXb'><q id='hxfXb'></q></dir></style></legend>
                      <tfoot id='hxfXb'></tfoot>

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

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