Send Web Request CORS Issues (How is this expected to work?)
Summary
Workflow: Workflow5
Activity: Send Web Request
Method: GET
Environment: Sandbox & Essentials Site
Question: How? CORS appears to be randomly blocking.
Details
I'm having trouble determining how Send Web Request works for GET requests without having a CORS error. It seems like a pretty simple and basic process, I must be missing a step or something.
Using the activity Send Web Request as GET throws CORS errors in the Workflow5 sandbox for the following urls:
- https://www.google.com
- https://apps.wrd.state.or.us/apps/sw/hydro_near_real_time/hydro_download.aspx?station_nbr=10329500&start_date=10/01/1991&end_date=09/30/2020&dataset=MDF&format=html
Send Web Request for these urls (POST) does not cause CORS errors:
How is a GET request expected to work in the workflow5 sandbox? I've tried using the Register CORS Url before the send request.
Figured maybe the sandbox was the problem so I added a command to launch the workflow5 from a geocortex site. I added https://apps.wrd.state.or.us to the Allow list in the manager and tried to launch the workflow. Same CORS error.
When setting up a Send Web Request using the GET method are there other required inputs? Do I need a specific Header? Does Expect need to match? Do I pass the url parameters in the Url input, Json input, or Form input? Does the workflow5 install have a config file with an allowed list for CORS?
-
The server may or may not return the required CORS headers in response to the Web Request. If it doesn't, and you don't control that server, you're out of luck, and you should use either a server workflow or a proxy script.
Using Fiddler, you can see that both highcharts and httpbin return Access-Control-Allow-Origin: *.
1 -
Thanks for the suggestion, Berend. Could you please elaborate on how to send the request with a proxy script?
0 -
Niluka Munasinghe Could you be more specific? If you have access to a GVH (Geocortex Viewer for HTML), I'd encourage you to take a look at the proxy.ashx script
0 -
Thanks for the response, Berend. I'm getting a CORS error because the current API response doesn't include the Access-Control-Allow-Origin header.
I had a look at the proxy.ashx file. But I'm not good with C#.
If you can guide me on configuring the proxy, that'd be really helpful.0 -
Niluka Munasinghe There is some excellent documentation here: https://docs.vertigisstudio.com/essentials/gvh/latest/install-help/Default.htm#gvh/install/proxy-page.htm
0
Please sign in to leave a comment.
Comments
5 comments