{"id":2090,"date":"2021-10-13T14:28:53","date_gmt":"2021-10-13T12:28:53","guid":{"rendered":"https:\/\/blog.kodono.info\/wordpress\/?p=2090"},"modified":"2021-10-13T14:28:53","modified_gmt":"2021-10-13T12:28:53","slug":"enable-cors-with-iis","status":"publish","type":"post","link":"https:\/\/blog.kodono.info\/wordpress\/2021\/10\/13\/enable-cors-with-iis\/","title":{"rendered":"Enable CORS with IIS"},"content":{"rendered":"<p>It&#8217;s as easy as editing the <code>web.config<\/code> file with the below:<\/p>\n<pre class=\"brush:xml\">\r\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n&lt;configuration>\r\n  &lt;system.webServer>\r\n    &lt;httpProtocol>\r\n      &lt;customHeaders>\r\n        &lt;add name=\"Access-Control-Allow-Origin\" value=\"https:\/\/my.site.com\" \/>\r\n        &lt;add name=\"Access-Control-Allow-Headers\" value=\"Authorization,Accept,Content-Type,X-Requested-With\" \/>\r\n        &lt;add name=\"Access-Control-Allow-Credentials\" value=\"true\" \/>\r\n      &lt;\/customHeaders>\r\n    &lt;\/httpProtocol>\r\n  &lt;\/system.webServer>\r\n&lt;\/configuration>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s as easy as editing the web.config file with the below: &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?> &lt;configuration> &lt;system.webServer> &lt;httpProtocol> &lt;customHeaders> &lt;add name=&#8221;Access-Control-Allow-Origin&#8221; value=&#8221;https:\/\/my.site.com&#8221; \/> &lt;add name=&#8221;Access-Control-Allow-Headers&#8221; value=&#8221;Authorization,Accept,Content-Type,X-Requested-With&#8221; \/> &lt;add name=&#8221;Access-Control-Allow-Credentials&#8221; value=&#8221;true&#8221; \/> &lt;\/customHeaders> &lt;\/httpProtocol> &lt;\/system.webServer> &lt;\/configuration><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[15,170],"tags":[153,123],"class_list":["post-2090","post","type-post","status-publish","format-standard","hentry","category-astuce","category-english","tag-astuce","tag-english"],"_links":{"self":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/comments?post=2090"}],"version-history":[{"count":1,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2090\/revisions"}],"predecessor-version":[{"id":2092,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/2090\/revisions\/2092"}],"wp:attachment":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/media?parent=2090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/categories?post=2090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/tags?post=2090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}