<?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 - yes, Still wretched CORS errors in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-yes-still-wretched-cors-errors/m-p/570596#M53198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to have spent the last decade chasing this one, but still fighting it, usually on a Friday afternoon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a site, on a server, let's call the server "myserver"&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myserver hosts AGS so we can call stuff with "myserver/arcgis/"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The site myserver hosts has an internally set name, lets say "maps"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so users go to http:\\maps to see maps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of this is now working, but one part of the code calls a Print service.&amp;nbsp; So -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://str-gis1/arcgis/rest/services/PrintService2/GPServer?f=json" title="http://str-gis1/arcgis/rest/services/PrintService2/GPServer?f=json"&gt;http://myserver/arcgis/rest/services/PrintService2/GPServer?f=json&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is when the dreaded CORS error kicks in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://str-gis1:6080/arcgis/admin/system/handlers/rest/servicesdirectory" title="http://str-gis1:6080/arcgis/admin/system/handlers/rest/servicesdirectory"&gt;http://myserver:6080/arcgis/admin/system/handlers/rest/servicesdirectory&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allowed Origins is set to *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code I&amp;nbsp; have added "esri.config.defaults.io.corsEnabledServers.push("myserver");"&amp;nbsp; using the short name and fully qualified name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding an Allowed Origins part to every possible web.config file I can see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still, I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Access to XMLHttpRequest at 'http://myserver/arcgis/rest/services/PrintService2/GPServer?f=json' from origin 'http://maps' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doomed to keep seeing this error until I retire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am losing hope of ever being able to sort it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Amazing, "fixed" this on a Friday afternoon - I added the port - myserver:6080 - which to me looks like the issue is in the Web Adaptor.&amp;nbsp; So still a question I'd love to get answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Sep 2020 14:24:23 GMT</pubDate>
    <dc:creator>AdrianMarsden</dc:creator>
    <dc:date>2020-09-18T14:24:23Z</dc:date>
    <item>
      <title>CORS - yes, Still wretched CORS errors</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-yes-still-wretched-cors-errors/m-p/570596#M53198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to have spent the last decade chasing this one, but still fighting it, usually on a Friday afternoon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a site, on a server, let's call the server "myserver"&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;myserver hosts AGS so we can call stuff with "myserver/arcgis/"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The site myserver hosts has an internally set name, lets say "maps"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so users go to http:\\maps to see maps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of this is now working, but one part of the code calls a Print service.&amp;nbsp; So -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://str-gis1/arcgis/rest/services/PrintService2/GPServer?f=json" title="http://str-gis1/arcgis/rest/services/PrintService2/GPServer?f=json"&gt;http://myserver/arcgis/rest/services/PrintService2/GPServer?f=json&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is when the dreaded CORS error kicks in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://str-gis1:6080/arcgis/admin/system/handlers/rest/servicesdirectory" title="http://str-gis1:6080/arcgis/admin/system/handlers/rest/servicesdirectory"&gt;http://myserver:6080/arcgis/admin/system/handlers/rest/servicesdirectory&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allowed Origins is set to *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the code I&amp;nbsp; have added "esri.config.defaults.io.corsEnabledServers.push("myserver");"&amp;nbsp; using the short name and fully qualified name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding an Allowed Origins part to every possible web.config file I can see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still, I get&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Access to XMLHttpRequest at 'http://myserver/arcgis/rest/services/PrintService2/GPServer?f=json' from origin 'http://maps' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doomed to keep seeing this error until I retire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am losing hope of ever being able to sort it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Amazing, "fixed" this on a Friday afternoon - I added the port - myserver:6080 - which to me looks like the issue is in the Web Adaptor.&amp;nbsp; So still a question I'd love to get answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2020 14:24:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-yes-still-wretched-cors-errors/m-p/570596#M53198</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2020-09-18T14:24:23Z</dc:date>
    </item>
  </channel>
</rss>

