Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi there!
Didn't want to open an issue, since I do not know if it's a bug or not.

I currently use Next.js, on server (NodeJS) side, everything works has expected.
However on client side, I received this error message:
Access to XMLHttpRequest at 'https://example.atlassian.net/wiki/rest/api/content?spaceKey=AA&expand=ancestors,body.view,descendants.page' from origin 'http://localhost:3001' 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.

I also use your other library jira.js and it works properly on client side.
Maybe this is related to a configuration to Axios, or something else.

Do you have any idea what the problem could be?
Thanks

You must be logged in to vote

Replies: 2 comments · 5 replies

Comment options

You must be logged in to vote
2 replies
@emulienfou
Comment options

Indeed, I get this error only in Browser side, but not in server side.

@MrRefactoring
Comment options

It's logically. You have setuped CORS policy in Next.js side?

Comment options

And I think this article will be helpful for you: https://nextjs.org/docs/api-routes/api-middlewares

You must be logged in to vote
3 replies
@emulienfou
Comment options

Yes I could create an API middleware that is used as a proxy to make the call to Concluence like as if i was in server side.
But I think this will be just a bandage and other people may have the same issues in the future!

@MrRefactoring
Comment options

Yeah. It's security behavior in browsers. Everyone should manage CORS policy by himself. And also I cannot impact on your server config.

Conclusion: you should manage your CORS policy in your server by yourself :)

@MrRefactoring
Comment options

Please let me know if you faced with any problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.