You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing a DELETE request using \Apple_Push_API\Request\Request::request(), the response is considered successful if the $response variable is null:
However, $response contains the return value from wp_safe_remote_request(), which, as far as I can tell, returns array|WP_Error and never null.
Steps To Reproduce
Perform a DELETE request using the request() method. Using XDebug or a similar debugger, observe that even a successful request does not return at the current check for null.
Additional Information
The Apple News developer documentation says that a successful DELETE request will return a 204 No Content. I wonder whether the current check was written as if $response contained the raw response body, which would indeed be empty on success.
The text was updated successfully, but these errors were encountered:
Description of the bug
When performing a
DELETE
request using\Apple_Push_API\Request\Request::request()
, the response is considered successful if the$response
variable isnull
:apple-news/includes/apple-push-api/request/class-request.php
Lines 414 to 415 in 6eedc79
However,
$response
contains the return value fromwp_safe_remote_request()
, which, as far as I can tell, returnsarray|WP_Error
and nevernull
.Steps To Reproduce
Perform a
DELETE
request using therequest()
method. Using XDebug or a similar debugger, observe that even a successful request does not return at the current check fornull
.Additional Information
The Apple News developer documentation says that a successful
DELETE
request will return a204 No Content
. I wonder whether the current check was written as if$response
contained the raw response body, which would indeed be empty on success.The text was updated successfully, but these errors were encountered: