-
Notifications
You must be signed in to change notification settings - Fork 9
[DEVREL-29] allow pretty permalinks to be handled for rest endpoints by default #181
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
Conversation
bypass the issue with bad string replacement by just parsing pretty permalinks natively for rest endpoints even when pretty permalinks aren't active
This is why "rebase and merge" exists. I'm going to cherry-pick them back over here. |
bypass the issue with bad string replacement by just parsing pretty permalinks natively for rest endpoints even when pretty permalinks aren't active
c088dd7 to
05feec7
Compare
|
Have not investigated why the bats tests failed. Will chat about this next week. |
Co-authored-by: Phil Tyler <[email protected]>
Co-authored-by: Phil Tyler <[email protected]>
…ntheon-systems/wordpress-composer-managed into devrel-29-fix-subdir-wpms-url-issue-2
if it fails, it shouldn't prevent site deletion
this shouldn't be a code comment
|
Hi from your friendly robot! 🤖
If issues are present, please ensure commits modify either 'normal' or 'non-release' files (not a mix within a single commit) and do not contain forbidden files. |
|
Going to close this PR and open a new one with two clean commits. |
Fixes #178
The linked issue is somewhat misrepresented. While the observed behavior is accurate (malformed URLs) it is not because of a misplaced
/wpin the REST url -- WP-API URLs on Bedrock-based sites are expected to have two/wp/strings in them -- one being the path to the application and the second is part of the actualwp-json/URL (e.g./wp-json/wp/v2/...). Therefore, the proposed solution would actually break sites without addressing the issue.Since the issue only exists on newly created sites, the assumption here is that these sites are not using "pretty permalinks". Indeed, our tests assume permalinks are pretty for this very reason. In cases when "pretty permalinks" are not active, it makes sense that API requests might fail due to our URL rewriting for internal paths.
This PR works around the issue by simply accepting "pretty"-style API endpoint paths while also preserving the functionality of "plain" permalinks. Both "plain" and "pretty" permalinks are henceforth supported by the REST API for WPCM sites.
Tests are broken out into #182 so as to not mix release and non-release commits and will fail until this PR is merged.Tests have been integrated back into this PR as well as other non-release changes. As a result, this PR MUST BE merged with a merge commit, not squash merge.