[wp-trac] [WordPress Trac] #40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't enabled

WordPress Trac noreply at wordpress.org
Tue Jul 25 00:49:24 UTC 2017


#40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't
enabled
---------------------------------------------+-----------------------
 Reporter:  Joen                             |       Owner:  pento
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  4.8.1
Component:  REST API                         |     Version:  4.4
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  rest-api
---------------------------------------------+-----------------------
Changes (by pento):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41139"]:
 {{{
 #!CommitTicketReference repository="" revision="41139"
 REST API: Always add `index.php` to the REST URL when pretty permalinks
 are disabled.

 When pretty permalinks are disabled, the web server will internally
 forward requests to `index.php`. Unfortunately, nginx only forwards
 HTTP/1.0 methods: `PUT`, `PATCH`, and `DELETE` methods will return a 405
 error.

 To work around this nginx behaviour, including `index.php` in the REST URL
 skips the internal redirect.

 Fixes #40886.
 }}}

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


More information about the wp-trac mailing list