<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>CORS on 瓶子裡的小狐狸</title>
    <link>https://szeching.com/tags/cors/</link>
    <description>Recent content in CORS on 瓶子裡的小狐狸</description>
    <generator>Hugo</generator>
    <language>zh-Hant</language>
    <lastBuildDate>Fri, 20 May 2022 10:10:00 +0000</lastBuildDate>
    <atom:link href="https://szeching.com/tags/cors/rss" rel="self" type="application/rss+xml" />
    <item>
      <title>Cross-Origin Resource Sharing (CORS) 跨來源資源共用錯誤解決方法</title>
      <link>https://szeching.com/fix-the-cors-error/</link>
      <pubDate>Fri, 20 May 2022 10:10:00 +0000</pubDate>
      <guid>https://szeching.com/fix-the-cors-error/</guid>
      <description>&lt;p&gt;最近Y cheung 遇到了兩個典型 CORS error問題，XMLHttpRequest 和 Fetch 請求了跨來源資源被瀏覽器阻擋，記錄一下解決方法。&lt;/p&gt;&#xA;&lt;h2 id=&#34;什麼是cross-origin-resource-sharing-cors-跨來源資源共用&#34;&gt;什麼是Cross-Origin Resource Sharing (CORS) 跨來源資源共用？&lt;a class=&#34;anchorjs-link&#34; href=&#34;#%e4%bb%80%e9%ba%bc%e6%98%afcross-origin-resource-sharing-cors-%e8%b7%a8%e4%be%86%e6%ba%90%e8%b3%87%e6%ba%90%e5%85%b1%e7%94%a8&#34;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Cross-Origin Resource Sharing (CORS)&lt;/strong&gt; is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources. CORS also relies on a mechanism by which browsers make a &amp;ldquo;preflight&amp;rdquo; request to the server hosting the cross-origin resource, in order to check that the server will permit the actual request. In that preflight, the browser sends headers that indicate the HTTP method and headers that will be used in the actual request.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
