WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/25/2017 12:53:47 AM (3 years ago)
Author:
pento
Message:

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.

Merges 41139 to the 4.8 branch.
Fixes #40886.

Location:
branches/4.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8

  • branches/4.8/tests/phpunit/tests/rest-api/rest-request.php

    r40815 r41140  
    548548            array(
    549549                'permalink_structure' => '',
    550                 'original_url'        => 'http://' . WP_TESTS_DOMAIN . '/?rest_route=%2Fwp%2Fv2%2Fposts%2F1&foo=bar',
     550                'original_url'        => 'http://' . WP_TESTS_DOMAIN . '/index.php?rest_route=%2Fwp%2Fv2%2Fposts%2F1&foo=bar',
    551551            ),
    552552        );
Note: See TracChangeset for help on using the changeset viewer.