[wp-trac] [WordPress Trac] #42828: Hard-coded 403 status in REST response should use `rest_authorization_required_code()`

WordPress Trac noreply at wordpress.org
Sat Dec 30 20:48:12 UTC 2017


#42828: Hard-coded 403 status in REST response should use
`rest_authorization_required_code()`
--------------------------+--------------------------
 Reporter:  jaswrks       |       Owner:  rachelbaker
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.9.2
Component:  REST API      |     Version:  4.7
 Severity:  normal        |  Resolution:  fixed
 Keywords:  commit        |     Focuses:  rest-api
--------------------------+--------------------------

Comment (by rachelbaker):

 In [changeset:"42422"]:
 {{{
 #!CommitTicketReference repository="" revision="42422"
 REST API: Return the proper status code for failed permission callbacks in
 WP_REST_Server->dispatch().

 Use the rest_authorization_required_code() function to return a 401 status
 code when a permission callback fails due to a user not being logged in.

 Merges [42421] to the 4.9 branch.

 Props jaswrks.
 Fixes #42828.
 }}}

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


More information about the wp-trac mailing list