[wp-trac] [WordPress Trac] #45933: WSODs protection returns incorrect content type for JSON Requests (was: WSODs protection returns incorrect content type)

WordPress Trac noreply at wordpress.org
Thu Jan 17 19:05:56 UTC 2019


#45933: WSODs protection returns incorrect content type for JSON Requests
--------------------------------------------------+------------------------
 Reporter:  spacedmonkey                          |       Owner:  flixos90
     Type:  defect (bug)                          |      Status:  reviewing
 Priority:  normal                                |   Milestone:  5.1
Component:  Bootstrap/Load                        |     Version:  trunk
 Severity:  normal                                |  Resolution:
 Keywords:  servehappy needs-patch needs-testing  |     Focuses:  multisite
--------------------------------------------------+------------------------
Description changed by spacedmonkey:

Old description:

> While testing WSODs protection  ( #44458 ), I noticed that on REST API
> calls and RSS feeds, that wrong content type is returned. The REST API
> expects valid json to be returned. Other invalid rest requests, return an
> error state  in the following format.
>
> {{{#!php
> {
>     code: "rest_no_route",
>     message: "No route was found matching the URL and request method",
>     data: {
>        status: 404
>     }
> }
> }}}
>
> As for RSS feeds, what is returned is not valid XML and will likely break
> most feed readers that are parsing them.
>
> This issue is that `wp_die`, has go handles for, admin ajax, xmlrpc and
> html responses. But doesn't check for feed or rest api rests.

New description:

 While testing WSODs protection  ( #44458 ), I noticed that on REST API
 calls that wrong content type is returned. The REST API expects valid json
 to be returned. Other invalid rest requests, return an error state  in the
 following format.

 {{{#!php
 {
     code: "rest_no_route",
     message: "No route was found matching the URL and request method",
     data: {
        status: 404
     }
 }
 }}}


 This issue is that `wp_die`, has go handles for, admin ajax, xmlrpc and
 html responses. But doesn't check for feed or rest api rests.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45933#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list