<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>CORS on Lin's Blog</title><link>http://coder.tw/tags/cors/</link><description>Recent content in CORS on Lin's Blog</description><generator>Hugo</generator><language>zh-tw</language><lastBuildDate>Wed, 04 Jan 2017 11:58:44 +0000</lastBuildDate><atom:link href="http://coder.tw/tags/cors/index.xml" rel="self" type="application/rss+xml"/><item><title>如何測試網站是否成功設定 CORS</title><link>http://coder.tw/posts/test-cors-enabled-on-website/</link><pubDate>Wed, 04 Jan 2017 11:58:44 +0000</pubDate><guid>http://coder.tw/posts/test-cors-enabled-on-website/</guid><description>&lt;p&gt;透過 Cross-Origin Resource Sharing（以下簡稱 CORS）的設定可以讓 JavaScript 突破瀏覽器同源政策，存取不同網域的資源（API），但每次設定完 CORS 都很頭痛要如何判斷伺服器真的有設定成功，因為有時候瀏覽器針對 CORS 會做快取，導致伺服器設定無誤，但不管你怎麼重新整理網頁都失敗的現象。這邊教大家用 cURL 直接檢視 header 是否有啟用 CORS 囉！&lt;/p&gt;</description></item><item><title>Set Cross-Origin Resource Sharing (CORS) Enable on Google Cloud Storage</title><link>http://coder.tw/posts/set-cross-origin-resource-sharing-cors-enable-on-google-cloud-storage/</link><pubDate>Fri, 02 Dec 2016 13:50:59 +0000</pubDate><guid>http://coder.tw/posts/set-cross-origin-resource-sharing-cors-enable-on-google-cloud-storage/</guid><description>&lt;p&gt;最近因為社課教大家用 Phaser 開發小遊戲，有許多素材需要讓學員在 Codepen 上使用，所以需要一個支援 CORS 的網路空間來放置素材，腦筋動著動著就想到便宜大碗又可以綁定自己 Domain 的 Google Cloud Storage 去啦！&lt;/p&gt;
&lt;p&gt;其實 Google Cloud Storage 預設是不支援 Cross-Origin Resource Sharing (CORS) 的，但只要透過 gsutil （Google Cloud Storage Cli Tool） 就可以幫指定的 Bucket 啟用 CORS 功能！&lt;/p&gt;</description></item></channel></rss>