-
Notifications
You must be signed in to change notification settings - Fork 381
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
Avoid failing validation requests when response is redirect #6069
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6069 +/- ##
=============================================
- Coverage 74.82% 74.81% -0.01%
- Complexity 5767 5771 +4
=============================================
Files 230 230
Lines 17486 17492 +6
=============================================
+ Hits 13084 13087 +3
- Misses 4402 4405 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Plugin builds for f634910 are ready 🛎️!
|
Co-authored-by: Alain Schlesser <[email protected]>
QA Passed Running the command
|
Summary
This fixes a regression introduced by ae36769 in #5296 whereby a validation request returned JSON error data if the response was not an AMP page. An exception is needed for when the response is not an AMP page and yet is an HTTP redirect. The
\AMP_Validation_Manager::validate_url()
follows redirects, so we should allow redirects to pass through.I discovered this when trying to do
wp amp validation run --limit=1 --include=is_date
which resulted in:This fixes that problem by allowing the request for
https://wordpressdev.lndo.site/?year=2021
to redirect tohttps://wordpressdev.lndo.site/2021/
.Also amends #6063 by undoing erroneous addition of is_callable() check in d0d2137.
Checklist