As suggested in lots of posts, I have tried almost all the solutions, I have installed jira server on local and using React js for writing rest calls,
Added localhost:3000 in the whitelist and tried disabling whitelist too.
Below is the error I am getting:
Access to fetch at 'http://localhost:8080/rest/api/2/issue/DUM-1/' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Below is the code snippet:
const url = "http://localhost:8080/rest/api/2/issue/DUM-1/";
fetch(url, {
method: 'GET',
headers: { 'Origin': 'http://localhost:3000',
'Content-type': 'application/json', 'Accept': 'application/json',
'Authentication': 'Basic ZGVlcGlrYWpuMDI6ZGVlcGFAMTAxMA==',
'Access-Control-Allow-Origin': "*",
'Access-Control-Allow-Methods': 'GET, POST, PATCH, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': "Origin, X-Requested-With, Content-Type, Accept, X-Auth-Token" } })
.then(response => response.json()) .then(json => {console.log(json)}) // .then(data => this.setState({ data })) .catch(error => console.log('Authorization failed : ' + error));
Thanks,
@Deepika Jain Hello Deepika, I am facing the same issue. Can you please help me to resolve the issue because it is very urgent for me. It would be great help
@Deepika Jain I m facing the same , u got solution ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mohamed Basith Hello brother any solution you got? because I am facing the similar issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.