<?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 Re: Yet another CORS issue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650499#M60659</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having the same issue. Were you able to resolve this?&amp;nbsp; I set the response header to enable Cors on the server and added esriConfig.defaults.io.corsEnabledServers to the code but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jun 2015 15:33:22 GMT</pubDate>
    <dc:creator>GaryBushek</dc:creator>
    <dc:date>2015-06-03T15:33:22Z</dc:date>
    <item>
      <title>Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650495#M60655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought I had seen the last of these.&amp;nbsp; However, I am trying to retrieve the EXIF metadata of attached images using this code &lt;A href="https://github.com/jseidelin/exif-js" title="https://github.com/jseidelin/exif-js" rel="nofollow noopener noreferrer" target="_blank"&gt;jseidelin/exif-js · GitHub&lt;/A&gt;&amp;nbsp; - it works when I run the example page and load in the full URL of the images returned via a " featureLayer.queryAttachmentInfos" command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the AGS server being a different domain to my site hits CORS issues - which I thought I had sorted by changes to web.config and adding the server name in with a "esri.config.defaults.io.corsEnabledServers.push"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to retrieve the data using a simple function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (index = 0; index &amp;lt; attachmentPath.length; ++index) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var image = new Image();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.src = attachmentPath[index];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 




&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; image.onload = function () { // always fires the event.




&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXIF.getData(this, function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.debug(this)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var make = EXIF.getTag(this, "Make"),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model = EXIF.getTag(this, "Model");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("I was taken by a " + make + " " + model);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....do stuff with the info returned
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;XMLHttpRequest cannot load &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;&amp;lt;server name&amp;gt;&amp;gt;/arcgis/rest/services/test/emap2/MapServer/22/2009/attachments/8. Request header field If-Modified-Since is not allowed by Access-Control-Allow-Headers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other requests to resources using the server name seem fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm stumped.&amp;nbsp; All I want to do is to know which way up to display the attachments!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650495#M60655</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2021-12-12T03:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650496#M60656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure that CORS is enabled on your ArcGIS Server? (Older versions of ArcGIS Server did not have CORS enabled by default.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 16:29:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650496#M60656</guid>
      <dc:creator>JeffJacobson</dc:creator>
      <dc:date>2015-03-25T16:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650497#M60657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using 10.2.2 and I believe it is all enabled - the same results occur when I strip the code out and have no AGS component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK - also tested it in IE - it gave me an alert about loading stuff outside of control, but loaded OK (failed elsewhere, but that my problem)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firefox gave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;&amp;lt;server name&amp;gt;&amp;gt;/arcgis/rest/services/test/emap2/MapServer/22/2006/attachments/6/index.html. This can be fixed by moving the resource to the same domain or enabling CORS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, assuming I haven't got CORS enabled - how do I?&amp;nbsp; I have read about this for several years now, and yet found a simple answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;customHeaders&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="Access-Control-Allow-Origin" value="*"/&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;/customHeaders&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my webconfig.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ACM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 09:30:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650497#M60657</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2015-03-26T09:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650498#M60658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, I think I am confused over what server needs what, or rather what part of the same server needs what.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have my AGS component.&amp;nbsp; That runs on the default website of&amp;nbsp; IIS .&amp;nbsp; It has a web.config and settings in IIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then there is my application.&amp;nbsp; On the same server, but a different site in IIS.&amp;nbsp; That also has its settings and (potentially) a web.config.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried all sorts of combinations of edits to web.config and either the page fails totally with a http 500, it fails with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The 'Access-Control-Allow-Origin' header contains multiple values '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://applicationservername" rel="nofollow" target="_blank"&gt;http://applicationservername&lt;/A&gt;&lt;SPAN&gt;, *', but only one is allowed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or the other error above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am really bashing head against wall here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 16:30:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650498#M60658</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2015-03-26T16:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650499#M60659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having the same issue. Were you able to resolve this?&amp;nbsp; I set the response header to enable Cors on the server and added esriConfig.defaults.io.corsEnabledServers to the code but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 15:33:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650499#M60659</guid>
      <dc:creator>GaryBushek</dc:creator>
      <dc:date>2015-06-03T15:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650500#M60660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Things are a lot better now.&amp;nbsp; I stripped things right back, removed any CORS related stuff from any web.config files (I had a few at different levels of the site) and ensured that the settings were only specifed in one location - I can't pinpoint what I did, as it was a case of trying loads of stuff at random.&amp;nbsp; I still don't know which part of the server was rejecting it, the calling page or the site being called.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 15:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650500#M60660</guid>
      <dc:creator>AdrianMarsden</dc:creator>
      <dc:date>2015-06-03T15:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Yet another CORS issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650501#M60661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just ran into a similar issue with the Access-Control-Allow-Headers not including the "pragma" header, for some reason a client applicaiton was adding that header to the request and then when my server did not echo it back as an acceptable header in the response header "Access-Control-Allow-Headers" the browser (google chrome) would fail the preflight and not perform the "get" operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does the web adapter or server handle the response for CORS requests or if this something i need to do inside my web.config.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note: i am running 10.3.1 portal on windows + web adapter in IIS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 14:27:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/yet-another-cors-issue/m-p/650501#M60661</guid>
      <dc:creator>AndrewRay1</dc:creator>
      <dc:date>2016-06-07T14:27:10Z</dc:date>
    </item>
  </channel>
</rss>

