fix error detection

This commit is contained in:
Matthias Pfefferle 2023-05-02 13:54:21 +02:00
parent 654cdd4174
commit 66942e6c62

View file

@ -43,7 +43,7 @@ class Http {
$response = \wp_safe_remote_post( $url, $args );
$code = \wp_remote_retrieve_response_code( $response );
if ( 400 >= $code && 500 <= $code ) {
if ( 400 <= $code && 500 >= $code ) {
$response = new WP_Error( $code, __( 'Failed HTTP Request', 'activitypub' ) );
}
@ -82,7 +82,7 @@ class Http {
$response = \wp_safe_remote_get( $url, $args );
$code = \wp_remote_retrieve_response_code( $response );
if ( 400 >= $code && 500 <= $code ) {
if ( 400 <= $code && 500 >= $code ) {
$response = new WP_Error( $code, __( 'Failed HTTP Request', 'activitypub' ) );
}