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!!
-
P pclark2 has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login