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

Add CORS error message to PHP requests #1441

Open
bgrgicak opened this issue May 21, 2024 · 0 comments
Open

Add CORS error message to PHP requests #1441

bgrgicak opened this issue May 21, 2024 · 0 comments
Labels
[Priority] High [Type] Bug An existing feature does not function as intended

Comments

@bgrgicak
Copy link
Collaborator

bgrgicak commented May 21, 2024

Let's log a detailed error message when HTTP request made by PHP fail due to a CORS error, e.g. like in this blueprint that calls wp_safe_remote_get('https://wordpress.org');.

Playground Web is limited when making HTTP requests to sites that support CORS. Because Playground runs in a browser it can only send requests to servers that allow CORS requests. A typical PHP server doesn't have this restriction.

When this happens the request fails silently. We should find a way of telling the developer what went wrong, it could even be an mu-plugin that overrides window.fetch with a version that logs an extra error message discussing CORS.

Related issues #1349 #772

@bgrgicak bgrgicak added [Priority] High [Type] Bug An existing feature does not function as intended labels May 21, 2024
@bgrgicak bgrgicak added this to the PHP Feature Parity milestone May 21, 2024
@adamziel adamziel moved this to Future work in Playground Board Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] High [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant