[wp-trac] [WordPress Trac] #57512: Warning as a part of API response

WordPress Trac noreply at wordpress.org
Fri Jan 20 10:20:42 UTC 2023


#57512: Warning as a part of API response
--------------------------+-----------------------------
 Reporter:  kalpeshh      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  6.1.1
 Severity:  normal        |   Keywords:  2nd-opinion
  Focuses:  rest-api      |
--------------------------+-----------------------------
 When I pass incorrect value in Authorization header, I see the warning as
 a part of REST response.

 **Sample API Request**

 {{{

 GET http://localhost/wordpress/wp-json/wp/v2/posts

 Authorization: Basic testheader

 }}}


 **Response:**
 {{{
 <br />
 <b>Warning</b>:  Undefined array key 1 in
 <b>C:\xampp\8.2.0\htdocs\wordpress\wp-includes\load.php</b> on line
 <b>125</b><br />
 }}}


 Can we set proper response code for this case with non 200 error code?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57512>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list