REST API: Trim trailing slashes from routes.

WordPress' rewrites do this usually, but the behaviour was inconsistent when using non-pretty permalinks.

Props joehoyle.
Fixes #38873.


git-svn-id: https://develop.svn.wordpress.org/trunk@39329 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan McCue 2016-11-21 05:45:31 +00:00
parent 096f23db65
commit 0cbea5855e

View File

@ -256,7 +256,7 @@ function rest_api_loaded() {
$server = rest_get_server();
// Fire off the request.
$server->serve_request( $GLOBALS['wp']->query_vars['rest_route'] );
$server->serve_request( untrailingslashit( $GLOBALS['wp']->query_vars['rest_route'] ) );
// We're done.
die();