{"id":426034,"date":"2021-04-03T00:28:15","date_gmt":"2021-04-02T16:28:15","guid":{"rendered":"http:\/\/4563.org\/?p=426034"},"modified":"2021-04-03T00:28:15","modified_gmt":"2021-04-02T16:28:15","slug":"%e6%9c%89%e4%ba%ba%e7%94%a8%e8%bf%87-requestly-%e7%9a%84-chrome-%e6%b5%8f%e8%a7%88%e5%99%a8%e6%8f%92%e4%bb%b6%e5%8e%bb%e7%a7%bb%e9%99%a4%e7%9b%b8%e5%85%b3%e7%9a%84-headers-%e4%b9%88%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=426034","title":{"rendered":"\u6709\u4eba\u7528\u8fc7 Requestly \u7684 chrome \u6d4f\u89c8\u5668\u63d2\u4ef6\u53bb\u79fb\u9664\u76f8\u5173\u7684 headers \u4e48\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u4eba\u7528\u8fc7 Requestly \u7684 chrome \u6d4f\u89c8\u5668\u63d2\u4ef6\u53bb\u79fb\u9664\u76f8\u5173\u7684 headers \u4e48\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>from origin 'http:\/\/localhost:8080' has been blocked by CORS policy: Request header field x-ads-app-version is not allowed by Access-Control-Allow-Headers in preflight response. <\/code><\/pre>\n<p>https:\/\/requestly.io\/<\/p>\n<p>google chrome \u7684\u4e00\u4e2a\u63d2\u4ef6\uff0c\u53ef\u4ee5\u4fee\u6539 request&#8217;s headers \u3002<\/p>\n<p>\u6211\u7528\u8fd9\u4e2a\u5efa\u4e86\u4e00\u4e2a remove request rule,\u628a x-ads-app-version \u4ece headers \u91cc\u9762\u79fb\u9664\u6389\u3002<\/p>\n<p>\u53ef\u662f\uff0c\u6211\u5728 requestly \u7684\u9875\u9762\u91cc\u9762\u770b\u5230\u4e86\u8fd9\u4e2a rule \u5df2\u7ecf\u751f\u6548\u4e86\u3002\u4f46\u662f\uff0c\u6211\u8fd8\u662f\u88ab CORS block \u5462\uff1f\u8fd8\u662f\u8bf4\uff0c\u8fd9\u4e2a\u662f\u88ab browser \u7ed9 block \u6389\u4e86\uff0crequest \u53d1\u51fa\u53bb\u4e86\u4e5f\u6ca1\u6709\u7528\uff1f<\/p>\n<p>p.s.<br \/> \u6211\u4e5f\u4e0b\u8f7d\u4e86\u4e00\u4e2a CORS \u63d2\u4ef6\uff0c\u80fd\u591f\u2018disable\u2019 CORS \u7684\uff0c\u8c8c\u4f3c\u4e5f\u6ca1\u6709\u7528\uff0c\u6211\u8fd8\u662f\u6536\u5230\u4e0a\u9762\u7684 block \u4fe1\u606f&#8230;&#8230;<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5718950\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dasbn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u76f4\u63a5\u8bd5\u8bd5\u5173\u95ed Chrome \u7684 CORS \u68c0\u67e5\u8bd5\u8bd5\uff0c\u4e0d\u77e5\u9053\u4f60\u662f\u4ec0\u4e48\u7cfb\u7edf\uff0c\u5173\u95ed CORS \u53ef\u4ee5\u770b\u770b\u4e0b\u9762\u8fd9\u4e2a\u3002<br \/>https:\/\/gist.github.com\/carolina-vallejo\/b74f20752842509f185f5f4a19dc0a1a <button onclick=\"lazyGist(this)\">\u00a0\u663e\u793a Gist \u4ee3\u7801\u00a0<\/button> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5718951\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jirajine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u4e2a\u63d2\u4ef6\u53eb cors everywhere\uff0c\u4e00\u952e\u5f00\u5173 cors \u68c0\u67e5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5718952\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Jirajine \u6ca1\u6709\u627e\u5230\u4f60\u8bf4\u7684\u8fd9\u4e2a\u63d2\u4ef6\u5462\u3002<br \/>\u6211\u73b0\u5728\u7528\u7684\u8fd9\u4e2a <br \/>https:\/\/chrome.google.com\/webstore\/detail\/allow-cors-access-control\/lhobafahddgcelffkeicbaginigeejlf<br \/>https:\/\/mybrowseraddon.com\/access-control-allow-origin.html<br \/>\u4f46\u662f\uff0c\u8c8c\u4f3c disable \u4e86\uff0c\u8fd8\u662f\u6267\u884c\u68c0\u67e5\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5718953\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yazoox <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dasbn \u55ef\uff0c\u6211\u73b0\u5728\u5c31\u662f disable security \u4f7f\u7528&#8230;&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5718954\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Jirajine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/cors-everywhere\/<br \/>\u5fd8\u4e86\u8fd9\u4e2a\u662f Firefox only \u7684\uff0c\u4e0d\u8fc7\u8fd9\u79cd\u63d2\u4ef6\u53cd\u6b63\u662f\u88c5\u5230\u5f00\u53d1\u7528\u6d4f\u89c8\u5668\u91cc\u7684\uff0c\u7528\u54ea\u4e2a\u90fd\u4e00\u6837\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u4eba\u7528\u8fc7 Requestly \u7684 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/426034"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=426034"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/426034\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=426034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=426034"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=426034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}