<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CORS Help!! in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697112#M26730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a GP service that generates a PDF report in reportlab based on a country clicked on a web map. I've placed the HTML/Javascript document on our web server for testing, and it's working (although we can only generate one report at a time, but that is a separate issue). I've tried to place this code in an HTML widget on our website and test it, and I keep getting the "&lt;STRONG&gt;XMLHttpRequest cannot load&amp;nbsp;&amp;nbsp;No 'Access-Control-Allow-Origin' header is present on the requested resource."&lt;/STRONG&gt; I've tried to follow every thread I've found on this (there are dozens) and added&lt;STRONG&gt; "&amp;nbsp;&amp;lt;add name="Access-Control-Allow-Origin" value="*" /&amp;gt;"&lt;/STRONG&gt; to the web config files on our proxy server and the arcgis web config in the wwwroot. I'm still getting this error when I run the tool. We have two other pages on our website that use a GP tool to generate charts and these pages do not throw up this error. I'm not sure how to get this working.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2017 14:49:19 GMT</pubDate>
    <dc:creator>LloydBronn</dc:creator>
    <dc:date>2017-03-13T14:49:19Z</dc:date>
    <item>
      <title>CORS Help!!</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697112#M26730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a GP service that generates a PDF report in reportlab based on a country clicked on a web map. I've placed the HTML/Javascript document on our web server for testing, and it's working (although we can only generate one report at a time, but that is a separate issue). I've tried to place this code in an HTML widget on our website and test it, and I keep getting the "&lt;STRONG&gt;XMLHttpRequest cannot load&amp;nbsp;&amp;nbsp;No 'Access-Control-Allow-Origin' header is present on the requested resource."&lt;/STRONG&gt; I've tried to follow every thread I've found on this (there are dozens) and added&lt;STRONG&gt; "&amp;nbsp;&amp;lt;add name="Access-Control-Allow-Origin" value="*" /&amp;gt;"&lt;/STRONG&gt; to the web config files on our proxy server and the arcgis web config in the wwwroot. I'm still getting this error when I run the tool. We have two other pages on our website that use a GP tool to generate charts and these pages do not throw up this error. I'm not sure how to get this working.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 14:49:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697112#M26730</guid>
      <dc:creator>LloydBronn</dc:creator>
      <dc:date>2017-03-13T14:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Help!!</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697113#M26731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still trying to figure this out. I've added this to different web config files, but it hasn't helped. I'm not sure which web.config file to alter. There are&amp;nbsp;three different ones in our wwwroot folder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;customHeaders&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;add&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;name&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Access-Control-Allow-Origin&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;*&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;add&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;name&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Access-Control-Allow-Headers&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;*&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;add&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;name&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Access-Control-Allow-Methods&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;*&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;customHeaders&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697113#M26731</guid>
      <dc:creator>LloydBronn</dc:creator>
      <dc:date>2021-12-12T05:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Help!!</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697114#M26732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just found this public CORS solution. I dropped this into the JavaScript and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt; &lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cors_api_host &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'cors-anywhere.herokuapp.com'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cors_api_url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2F" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; cors_api_host &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'/'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; slice &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;slice&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; origin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; window&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;location&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;protocol &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; '&lt;SPAN class="comment token"&gt;//' + window.location.host;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; open &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; XMLHttpRequest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;prototype&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;open&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
XMLHttpRequest&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;prototype&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;open &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; args &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; slice&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;call&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arguments&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; targetOrigin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="regex token"&gt;/^https?:\/\/([^\/]+)/i&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;exec&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;args&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetOrigin &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; targetOrigin&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toLowerCase&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!==&lt;/SPAN&gt; origin &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt;
targetOrigin&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!==&lt;/SPAN&gt; cors_api_host&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
args&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cors_api_url &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; open&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;apply&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697114#M26732</guid>
      <dc:creator>LloydBronn</dc:creator>
      <dc:date>2021-12-12T05:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Help!!</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697115#M26733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm...personally, I wouldn't do this in PROD. If you have to, I'd download and host this API in house in your shop. Most current web servers set CORS headers by default. I'd set those headers in the web.config on the root of your web server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;A public demo of CORS Anywhere is available at &lt;A href="https://cors-anywhere.herokuapp.com/"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;https://cors-anywhere.herokuapp.com&lt;/SPAN&gt;&lt;/A&gt;. This server is only provided so that you can easily and quickly try out CORS Anywhere. To ensure that the service stays available to everyone, the number of requests per period is limited, except for requests from some explicitly whitelisted origins.&lt;/P&gt;&lt;P&gt;If you expect lots of traffic, please host your own instance of CORS Anywhere, and make sure that the CORS Anywhere server only whitelists your site to prevent others from using your instance of CORS Anywhere as an open proxy."&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 16:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697115#M26733</guid>
      <dc:creator>RandallWilliams</dc:creator>
      <dc:date>2017-03-17T16:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: CORS Help!!</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697116#M26734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I set the headers in our web.config and still got those errors.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 21:48:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/cors-help/m-p/697116#M26734</guid>
      <dc:creator>LloydBronn</dc:creator>
      <dc:date>2017-03-17T21:48:29Z</dc:date>
    </item>
  </channel>
</rss>

