Select to view content in your preferred language

Layer is using proxy when set to visible and it shouldn't use it [URL does not match with Proxy Rules] [ArcGIS JS API 4.12]

1012
1
07-12-2019 06:07 PM
RoelGarcia
Occasional Contributor

Basically, what I am doing it so simple, I created html page to load a web map from a portal and added the layer list widget, I have implemented security process (Proxy), I am setting the configutration to 'esri/confi' and  the proxy rules to 'esri/core/urlUtils', when I am setting this layer to visible in the view this layer is trying to use the proxy even if the url not match with the proxy rules.

Proxy configuration:
esriConfig.portalUrl = 'https://devgis.connect.calamp.com/portal/sharing/content/items';
esriConfig.request.proxyUrl = "https://devgis.connect.calamp.com/qa-arcgis-proxy/proxy.ashx";
urlUtils.addProxyRule({
     urlPrefix: "devgis.connect.calamp.com/server/rest/services/QA",
     proxyUrl: "https://devgis.connect.calamp.com/qa-arcgis-proxy/proxy.ashx"
});
esriConfig.request.trustedServers.push("devgis.connect.calamp.com");

Current Query: [Incorrect]
https://devgis.connect.calamp.com/qa-arcgis-proxy/proxy.ashx?http://qa.connect.calamp.com/twc/radar/...

Should be like this: [Correct]
http://qa.connect.calamp.com/twc/radar/2/2/1/f604af232a9a41c784af232a9a21c73f

Because the URL Layer does not match with the proxy rules.. I wondering if I am missing something or it is a bug in 4.x.


Please let me know if you have any idea!!

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Roel,

   What about the servers that are configured in your Proxies proxy.config? Do you have a generic http://qa.connect.calamp.com with a matchAll = true?

0 Kudos