[wp-trac] [WordPress Trac] #35975: OPTIONS request to REST API does not return correct Accept header

WordPress Trac noreply at wordpress.org
Thu Mar 3 09:38:07 UTC 2016


#35975: OPTIONS request to REST API does not return correct Accept header
--------------------------------------+------------------
 Reporter:  joehoyle                  |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.5
Component:  REST API                  |     Version:  4.4
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------
Changes (by joehoyle):

 * keywords:  has-patch needs-unit-tests => has-patch has-unit-tests


Comment:

 @rmccue I've removed the Accept header handling entirely from the OPTIONS
 request handler, and instead let that be ticket up by the function
 `rest_send_allow_header`. Also added unit tests for this.

 Good news is we were only sending Accept (when we meant Allow) on OPTIONS
 responses, which were also not checking permissions checks. This means if
 someone was relying on Accept (when then actually wanted allow), the value
 they were relying on was likely incorrect too.

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


More information about the wp-trac mailing list