{"id":8639,"date":"2020-04-13T11:00:47","date_gmt":"2020-04-13T02:00:47","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=8639"},"modified":"2020-04-13T21:15:03","modified_gmt":"2020-04-13T12:15:03","slug":"corscross-origin-resource-sharing","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/8639","title":{"rendered":"CORS(cross origin resource sharing)"},"content":{"rendered":"\n<p>Today I will talk about cors , cross origin resource sharing. What its exactly and how we can handle it.<\/p>\n\n\n\n<p>&#8220;CORS&#8221; stands for Cross-Source Resource Exchange. It allows you to make requests from one website to another website in the browser, which is normally prohibited by another browser policy called Same Source Policy (SOP).<\/p>\n\n\n\n<p>You also have to know about SOP, same origin policy. CORS and SOP are browser policies that have been developed in response to security issues and browser vulnerabilities.<\/p>\n\n\n\n<p>The browser-specific vulnerability that the Same Source Policy is intended to address is called &#8220;cross-site request forgery&#8221; (CSRF). The easy fix was for browsers to detect when a request is made from one website to another and prevent the response from being readable. This is the Same-Origin Policy.<\/p>\n\n\n\n<p>Web servers that want to support CORS requests must respond to preflight requests with the following HTTP headers:<\/p>\n\n\n\n<p>Access-Control-Allow-Origin: the whitelist origin, or &#8220;*&#8221;<br>Access-Control-Allow-Methods &#8211; A comma-separated list of HTTP methods that the web server wants to allow for cross-origin requests<br>Access-Control-Allow-Headers &#8211; A comma-separated list of HTTP headers that the web server wants to allow for cross-origin requests<\/p>\n\n\n\n<p>By Yuuma.<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8639\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/8639\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"CORS(cross origin resource sharing)\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8639\" data-text=\"CORS(cross origin resource sharing)\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8639\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8639\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>Today I will talk about cors , cross origin resource sharing. What its exactly and how we can handle it. &#038;#822 [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8639"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=8639"}],"version-history":[{"count":2,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8639\/revisions"}],"predecessor-version":[{"id":8642,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8639\/revisions\/8642"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=8639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=8639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=8639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}