feat: Allow Android WebView admin-ajax.php CORS requests#45292
feat: Allow Android WebView admin-ajax.php CORS requests#45292
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
7c65124 to
0eec284
Compare
1e87e88 to
947871d
Compare
0eec284 to
2ebdfb2
Compare
947871d to
5c0702b
Compare
2ebdfb2 to
b5d50be
Compare
5c0702b to
0cc2139
Compare
b5d50be to
d56e487
Compare
46ba2ef to
5d316d9
Compare
d56e487 to
cf08962
Compare
5d316d9 to
67fa677
Compare
cf08962 to
ae35d6d
Compare
67fa677 to
a374c90
Compare
ae35d6d to
8dd337f
Compare
a374c90 to
a599d22
Compare
a599d22 to
54ef71f
Compare
The Jetpack mobile app block editor relies upon Android WebViews for serving local Gutenberg files. Editor requests then originate from the platform-default `https://appassets.androidplatform.net` origin. To enable `admin-ajax.php` requests from the Android app, we must allow CORS requests from this origin.
Use a domain owned by the Jetpack project.
The domain was updated in a previous commit.
Re-run CI tasks after changing GitHub PR base branch.
275dc4a to
3c95750
Compare
|
Closing this as I now believe it unnecessary. It seems possible to avoid CORS altogether by using the site's domain for loading the local assets in the WebView. Sorry for the noise. |
Ref CMM-713. Ref CMM-766. Ref CMM-767.
Related: 209198-ghe-Automattic/wpcom
Proposed changes:
The Jetpack mobile app block editor relies upon Android WebViews for serving local Gutenberg files. Editor requests then originate from the
https://android-app-assets.jetpack.comorigin. To enableadmin-ajax.phprequests from the Android app, we must allow CORS requests from this origin.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
Important
WP.com sites require 209198-ghe-Automattic/wpcom as well.
Apply the changes to your site (see comment below). Verify the correct headers are returned for various request structures:
admin-ajaxvs non-admin-ajaxAn example script is provided below showcasing requests and expectations. The script can be run against a local Jetpack Docker environment site.
jetpack docker up -djetpack docker installgit switch trunkExample test script