Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Feature: add server response headers for CORS #939

Merged
merged 1 commit into from Jul 16, 2022

Conversation

iamlongalong
Copy link
Contributor

I am using PicGo for uploading my image to qiniu in obsidian ( A markdown editor ),but I got a CORS error, as the PicGo server is designed for local upload, It may should allow any of origin.
this can resolve this case.

what do you think of cors ? should it be an item of config or just set '*' for any origin ?

'Content-Type': 'application/json',
'access-control-allow-headers': '*',
'access-control-allow-methods': 'POST, GET, OPTIONS',
'access-control-allow-origin': '*'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'*' will not work in some cases.

Use the referer or host of the request will be better, so called dynamic cors.

However, '*' can face many cases so I will merge this PR. We will upgrade it when needed.

@iamlongalong
Copy link
Contributor Author

iamlongalong commented Jul 16, 2022 via email

@Molunerfinn
Copy link
Owner

Thanks for contribution! The next time use https://github.com/PicGo/bump-version will be better!

@Molunerfinn Molunerfinn changed the title add server response headers for CORS ✨ Feature: add server response headers for CORS Jul 16, 2022
@Molunerfinn Molunerfinn merged commit fb69bad into Molunerfinn:dev Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants