-
Notifications
You must be signed in to change notification settings - Fork 69
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
Validate route params before making request #8901
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.25 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment on the server issue.
…/woocommerce-payments into update/route-param-validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
This reverts commit bbdbafb.
This reverts commit bbdbafb.
This PR reverts #8901 which introduced stricter REST route validation of unique object IDs. Restoring the validation of these URLs to the state in WooPayments 7.7.0. The original PR increased validation with stricter object ID's checking moving from `\w+` to `[A-Za-z0-9]+` regex. Charges and disputes also had specific prefixes required `(ch|py|pi)_` and `(dispute|dp)_`. After the release of WooPayments 7.8.0 reports came in that confirmed dispute objects can also have a prefix of `du_`. Due to the original PR, these disputes were unable to viewed or responded to. As per [Stripe docs](https://docs.stripe.com/upgrades#what-changes-does-stripe-consider-to-be-backwards-compatible), changing ID prefixes is considered backwards compatible: > Stripe considers the following changes to be backwards-compatible: > Changing the length or format of opaque strings, such as object IDs, error messages, and other human-readable strings. > This includes adding or removing fixed prefixes (such as ch_ on charge IDs).⚠️
This PR reverts #8901 which introduced stricter REST route validation of unique object IDs. Restoring the validation of these URLs to the state in WooPayments 7.7.0. The original PR increased validation with stricter object ID's checking moving from `\w+` to `[A-Za-z0-9]+` regex. Charges and disputes also had specific prefixes required `(ch|py|pi)_` and `(dispute|dp)_`. After the release of WooPayments 7.8.0 reports came in that confirmed dispute objects can also have a prefix of `du_`. Due to the original PR, these disputes were unable to viewed or responded to. As per [Stripe docs](https://docs.stripe.com/upgrades#what-changes-does-stripe-consider-to-be-backwards-compatible), changing ID prefixes is considered backwards compatible: > Stripe considers the following changes to be backwards-compatible: > Changing the length or format of opaque strings, such as object IDs, error messages, and other human-readable strings. > This includes adding or removing fixed prefixes (such as ch_ on charge IDs).⚠️
Fixes https://github.com/Automattic/woocommerce-payments-server/issues/1548
Changes proposed in this Pull Request
Testing instructions
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge