Read the statement by Michael Teeuw here.
Trouble using CORS proxy
-
I am trying to use the built in CORS proxy to call the Jira API. I’ve successfully done this before using CORS Anywhere, but would prefer to use the built in proxy. It seems to be returning an empty result of {}, even though it should return more even if you aren’t authenticated. I’m assuming I am just using the proxy function incorrectly. Below is my code:
const headers = `Authorization:${"Basic " + btoa(this.config.username + ":" + this.config.apiKey)}`; const url = "/cors?sendheaders=" + encodeURIComponent(headers) + "&url=" + encodeURIComponent(`${this.config.jiraInstance}/rest/api/latest/search?jql=${this.config.jiraFilter}&maxResults=${this.config.maxResults}`);
I should note that my coding knowledge is extremely limited, so I am really going beyond my abilities here. Anything here jump out to anyone?
-
I figured out the solution. Simply, I didn’t need the proxy at all and instead just needed to use node_helper.js to make the API call for me. Made sense once I thought of it. I THINK my module is now working fully as expected, but I’ll monitor it over the next week or so to make sure.
-
@pclark2 the cors proxy is not full function.
in my use i do not encode the required url
i dont supply any parameters to the url
i also see empty results often -
I figured out the solution. Simply, I didn’t need the proxy at all and instead just needed to use node_helper.js to make the API call for me. Made sense once I thought of it. I THINK my module is now working fully as expected, but I’ll monitor it over the next week or so to make sure.
-
@pclark2 woohoo!!
-