Merge pull request #21491 from thiscouldbejd/patch-1

Avoid treating HTTP 301 and 302 Codes as Failures
This commit is contained in:
Claudiu Lodromanean 2018-10-03 16:57:12 -04:00 committed by GitHub
commit 282f78d59e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -442,7 +442,8 @@ class WC_Webhook extends WC_Legacy_Webhook {
);
// Track failures.
if ( intval( $response_code ) >= 200 && intval( $response_code ) < 300 ) {
// Check for a success, which is a 2xx, 301 or 302 Response Code.
if ( intval( $response_code ) >= 200 && intval( $response_code ) < 303 ) {
$this->set_failure_count( 0 );
$this->save();
} else {