{"id":158632,"date":"2020-09-11T15:08:04","date_gmt":"2020-09-11T07:08:04","guid":{"rendered":"http:\/\/4563.org\/?p=158632"},"modified":"2020-09-11T15:08:04","modified_gmt":"2020-09-11T07:08:04","slug":"%e5%a4%a7%e5%ae%b6%e8%b0%83%e8%af%95%e5%89%8d%e7%ab%af%e7%bd%91%e7%bb%9c%e8%af%b7%e6%b1%82%e7%94%a8-chrome-%e8%bf%98%e6%98%af-firefox","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=158632","title":{"rendered":"\u5927\u5bb6\u8c03\u8bd5\u524d\u7aef\u7f51\u7edc\u8bf7\u6c42\u7528 Chrome \u8fd8\u662f Firefox"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5927\u5bb6\u8c03\u8bd5\u524d\u7aef\u7f51\u7edc\u8bf7\u6c42\u7528 Chrome \u8fd8\u662f Firefox               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vision1900 <\/span>  <span><i><\/i> 6<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4eca\u5929\u5c1d\u8bd5\u7528 ExpressJS \u505a\u4e00\u4e2a\u7b80\u5355\u7684\u63a5\u53e3 \u521a\u5f00\u59cb\u6ca1\u6709\u7528 cors \u4e2d\u95f4\u4ef6\uff0c\u76f4\u63a5\u5728\u56de\u8c03\u51fd\u6570\u4e2d\u624b\u52a8\u8bbe\u7f6e Access-Controll-Allow \u90a3\u51e0\u4e2a\u8bf7\u6c42\u5934<\/p>\n<p>\u5728 Chrome \u4e0b\u8c03\u8bd5\u524d\u7aef\uff0cget \u8bf7\u6c42\u662f OK \u7684\uff0cPOST \u8bf7\u6c42\u4e0d\u884c\uff0cconsole log \u663e\u793a\u662f CORS \u95ee\u9898\u3002\u4e8e\u662f\u6253\u5f00\u7f51\u7edc\u9762\u677f\uff0c\u9009\u4e2d XHR\uff0c\u53d1\u73b0\u53ea\u6709 2 \u4e2a \u8bf7\u6c42\uff0c\u6210\u529f\u4e86\u7684 GET \u548c\u5931\u8d25\u4e86\u7684 POST \u8bf7\u6c42\uff0cPOST \u8bf7\u6c42\u663e\u793a Provisional header are shown \u3002\u4e00\u8138\u61f5\u903c\uff0c\u5fc3\u60f3\u6211\u660e\u660e\u8bbe\u7f6e\u4e86 CORS \u90a3\u4e9b\u8bf7\u6c42\u5934\uff0c\u8fd9\u4e5f\u6ca1\u6709 OPTIONS \u8bf7\u6c42\uff0c\u6240\u4ee5\u4e0d\u5b58\u5728 preflgiht\uff0c\u5230\u5e95\u662f\u54ea\u91cc\u51fa\u4e86\u95ee\u9898\uff1f \u540e\u6765\u6253\u5f00 Firefox\uff0c\u663e\u793a POST \u8bf7\u6c42\u524d\u53d1\u9001\u4e86 OPTIONS \u8bf7\u6c42\uff01\uff01\uff01<\/p>\n<p>\u4e4b\u524d\u770b youtube \u4e0a\u6709\u63a8\u9001\uff0c\u6807\u9898\u5927\u6982\u662f\u4f5c\u4e3a\u4e00\u4e2a Web \u5f00\u53d1\u8005\u4f60\u4e3a\u4ec0\u4e48\u8be5\u4f7f\u7528 Firefox \u800c\u4e0d\u662f Chrome\uff0c\u5185\u5bb9\u4e3b\u8981\u662f Firefox \u4e3a\u8c03\u8bd5 CSS \u63d0\u4f9b\u4e86\u5404\u79cd\u65b9\u4fbf\u3002\u4f46\u6ca1\u6709\u5728\u610f\uff0c\u8ba4\u4e3a firefox \u7684 UI \u7ec6\u8282\u6bd4\u8f83\u7c97\u7cd9\u6ca1\u6709 Chrome \u6253\u78e8\u7684\u597d\uff0c\u521a\u4e0b\u8f7d\u8fd8\u81ea\u5e26\u5e7f\u544a \u4eca\u5929\u662f\u7ed9\u6211\u4e0a\u4e86\u4e00\u8bfe\uff0c\u60f3\u8d77\u4e86\u4e4b\u524d\u4f20\u9001 form data \u65f6\u5982\u679c\u662f\u6587\u4ef6 Chrome \u90fd\u4e0d\u4f1a\u663e\u793a\u6587\u4ef6\u7684 payload\uff0c\u800c firefox \u53ef\u4ee5\uff0c\u51b3\u5b9a\u4ee5\u540e\u8c03\u8bd5\u7528 Firefox \u4e86<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3395720\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sunjourney <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             chrome<\/p>\n<p>1. \u5982\u679c chrome \u6709 bug\uff0c\u90a3\u5c31\u662f\u6240\u6709\u4eba\u7684\u7684 feature<br \/>2. \u4e0d\u77e5\u9053\u7684\u60c5\u51b5\u54ea\u6709\u95ee\u9898\uff0c\u4f46\u662f\u8fd9\u5e94\u8be5\u662f\u4e0d\u53ef\u80fd\u53d1\u751f\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395721\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : demonlin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Postman \u624d\u662f\u6d4b\u8bd5\u63a5\u53e3\u53d1\u8bf7\u6c42\u7528\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395722\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ijrou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             chrome\uff0c\u4e0d\u89e3\u91ca\uff0c\u633a\u723d\u7684\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395723\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : freshgoose <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             chrome \u5f88\u591a\u8bf7\u6c42\u90fd\u4e0d\u663e\u793a response body\uff0cfirefox \u5c31\u53ef\u4ee5\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395724\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : infun <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @freshgoose \u90a3\u662f\u56e0\u4e3a post \u5728 chrome \u91cc\u53d1\u4e24\u6b21\uff0c\u4f60\u770b\u5230\u7684\u6ca1\u6709 response body \u7684\u662f\u6325\u624b\u7684\u90a3\u6b21                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395725\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : des <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             edge\uff0c\u5fae\u8f6f\u592a\u5b9e\u5728\u4e86\uff0c\u76f4\u63a5\u6240\u6709\u4e1c\u897f\u90fd\u7ffb\u8bd1\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395726\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vision1900 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5fc3\u60f3\u6211\u660e\u660e\u8bbe\u7f6e\u4e86 CORS \u90a3\u4e9b\u8bf7\u6c42\u5934<br \/>\u62b1\u6b49\uff0c\u8fd9\u53e5\u8bdd\u6709\u8bef\uff0c\u662f\u8fd4\u56de\u5934\uff0c\u4e0d\u662f\u8bf7\u6c42\u5934<br \/>\u6709\u4eba\u63d0\u5230\u4e86 Postman\uff0c\u6211\u53ea\u7528\u8fc7\u4e00\u6b21\uff0c\u6ca1\u89c9\u5f97\u548c curl \u6709\u4ec0\u4e48\u533a\u522b\u3002<br \/>\u7528\u6d4f\u89c8\u5668\u5927\u90e8\u5206\u60c5\u51b5\u662f\u65b9\u4fbf\uff0c\u4e0d\u7528\u5207\u6362\u5e94\u7528 <br \/>\u518d\u8005\uff0c\u6d4b\u8bd5 CORS \u6ca1\u6d4f\u89c8\u5668\u4e0d\u884c\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395727\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vision1900 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u5f88\u559c\u6b22 Chrome \u7684 UI\/UX\uff0c\u5bf9\u5b83\u4e0d\u6ee1\u4e3b\u8981\u662f\u5b83\u5bf9 Web \u5f00\u53d1\u8005\u6ca1\u90a3\u4e48\u53cb\u597d<br \/>\u4e3a\u4e86 UI \u7684\u7b80\u6d01\uff0c\u5730\u5740\u680f \u662f http \u8fd8\u662f https \u88ab\u9690\u85cf\u4e86<br \/>\u4e0d\u663e\u793a OPTIONS \u8bf7\u6c42\u5bfc\u81f4\u6211\u8ba4\u4e3a CORS \u7684 preflight \u6ca1\u6709\u53d1\u751f<br \/>\u7528 form-data \u4e0a\u4f20\u6587\u4ef6\u7684\u65f6\u5019\u4e0d\u663e\u793a \u6587\u4ef6\u7684 payload<br \/>\u5728 Firefox \u4e2d\u8fd9\u4e9b\u5168\u90fd\u6709                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3395728\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ochatokori <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u540c\u88ab\u4e0d\u663e\u793a options \u8bf7\u6c42\u5751\u8fc7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u8c03\u8bd5\u524d\u7aef\u7f51\u7edc\u8bf7\u6c42\u7528 Chrom&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\/158632"}],"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=158632"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/158632\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=158632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=158632"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=158632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}