<?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 JS API 3.7, proxy.ashx fails for requests with content-encoding: gzip in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-3-7-proxy-ashx-fails-for-requests-with/m-p/1081324#M73969</link>
    <description>&lt;P&gt;3.7 web app that's been running for a few years now, just recently started having issues with the proxy.ashx. We have the latest .net proxy installed, ver 1.1.2, app/proxy both hosted on IIS 8.5. This is also the same machine running portal/server web adaptors.&lt;/P&gt;&lt;P&gt;When the app starts loading feature tables, the below request fails with: &lt;FONT size="2" color="#FF0000"&gt;net::ERR_CONTENT_DECODING_FAILED 200 (OK)&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/0/query?f=json&amp;amp;returnIdsOnly=true&amp;amp;token=12345" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;https://app.ourdomain.com/proxy/proxy.ashx?https://gis&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.ourdomain&lt;/SPAN&gt;&lt;A href="https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/0/query?f=json&amp;amp;returnIdsOnly=true&amp;amp;token=12345" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/0/query?f=json&amp;amp;returnIdsOnly=true&amp;amp;token=12345&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="response_headers.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19036i8BAFE99C382870D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="response_headers.png" alt="response_headers.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try the request without going through the proxy, everything works as-expected. So ArcGIS server and the hosted datastore are all operating normally. The ArcGIS server logs also display nothing.&lt;/P&gt;&lt;P&gt;Other requests through the proxy and have no issues, like below.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/1?f=json&amp;amp;token=12345" target="_blank" rel="noopener"&gt;https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/1?f=json&amp;amp;token=12345&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="response_headers.png" style="width: 311px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19037iC4C8AC190055A63B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="response_headers.png" alt="response_headers.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last test was to comment out the proxy config from the JS web app&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//esriConfig.defaults.io.proxyUrl = "/proxy/proxy.ashx"
//esriConfig.defaults.io.alwaysUseProxy = true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then "enable" CORS with JS API 3.7 via unsafe-eval.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval' https://js.arcgis.com; object-src 'self'"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything then works as-expected, but our customer will never be able to visit a site with unsafe-eval in the header.&lt;/P&gt;&lt;P&gt;Any advice here? What is all of a sudden going on with our .ashx proxy? .net Windows updates? IIS 8 updates?&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 14:33:28 GMT</pubDate>
    <dc:creator>danbecker</dc:creator>
    <dc:date>2021-07-21T14:33:28Z</dc:date>
    <item>
      <title>JS API 3.7, proxy.ashx fails for requests with content-encoding: gzip</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-3-7-proxy-ashx-fails-for-requests-with/m-p/1081324#M73969</link>
      <description>&lt;P&gt;3.7 web app that's been running for a few years now, just recently started having issues with the proxy.ashx. We have the latest .net proxy installed, ver 1.1.2, app/proxy both hosted on IIS 8.5. This is also the same machine running portal/server web adaptors.&lt;/P&gt;&lt;P&gt;When the app starts loading feature tables, the below request fails with: &lt;FONT size="2" color="#FF0000"&gt;net::ERR_CONTENT_DECODING_FAILED 200 (OK)&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/0/query?f=json&amp;amp;returnIdsOnly=true&amp;amp;token=12345" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;https://app.ourdomain.com/proxy/proxy.ashx?https://gis&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.ourdomain&lt;/SPAN&gt;&lt;A href="https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/0/query?f=json&amp;amp;returnIdsOnly=true&amp;amp;token=12345" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/0/query?f=json&amp;amp;returnIdsOnly=true&amp;amp;token=12345&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="response_headers.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19036i8BAFE99C382870D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="response_headers.png" alt="response_headers.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try the request without going through the proxy, everything works as-expected. So ArcGIS server and the hosted datastore are all operating normally. The ArcGIS server logs also display nothing.&lt;/P&gt;&lt;P&gt;Other requests through the proxy and have no issues, like below.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/1?f=json&amp;amp;token=12345" target="_blank" rel="noopener"&gt;https://app.ourdomain.com/proxy/proxy.ashx?https://gis.ourdomain.com/server/rest/services/Hosted/ReviewerDB2/FeatureServer/1?f=json&amp;amp;token=12345&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="response_headers.png" style="width: 311px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19037iC4C8AC190055A63B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="response_headers.png" alt="response_headers.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last test was to comment out the proxy config from the JS web app&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//esriConfig.defaults.io.proxyUrl = "/proxy/proxy.ashx"
//esriConfig.defaults.io.alwaysUseProxy = true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then "enable" CORS with JS API 3.7 via unsafe-eval.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval' https://js.arcgis.com; object-src 'self'"&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything then works as-expected, but our customer will never be able to visit a site with unsafe-eval in the header.&lt;/P&gt;&lt;P&gt;Any advice here? What is all of a sudden going on with our .ashx proxy? .net Windows updates? IIS 8 updates?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 14:33:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-3-7-proxy-ashx-fails-for-requests-with/m-p/1081324#M73969</guid>
      <dc:creator>danbecker</dc:creator>
      <dc:date>2021-07-21T14:33:28Z</dc:date>
    </item>
  </channel>
</rss>

