The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • How do you by pass the Cross-Origin Resource Sharing error you get when you try to access REST plugin from jquery

How do you by pass the Cross-Origin Resource Sharing error you get when you try to access REST plugin from jquery

Pramod Kutty
June 11, 2015

I have created a plugin which sends json data back I am getting an error when accessing from jquery cross-origin resource sharing  saying that request is coming from another domain  . I used jsonp but cannot use application/javascript or MediaType.TEXT_HTML as the server is throwing a 500 error saying this format is not supported

Is there any way to bypass CROS with either setting in JIRA or jquery

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Pramod Kutty
June 11, 2015

Got it need to set the 

contentType ="application/x-www-form-urlencoded; charset=utf-8" 

 

and set 

response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with");

 

in server

Franziska Witt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 3, 2016

Where do I have to set response.Header.... in server? Can you describe it more specific?

TAGS
AUG Leaders

Atlassian Community Events