REST API doesn't match with trailing slash when not using rewrites
|Reported by:||joehoyle||Owned by:||rmccue|
Description (last modified by jnylen0)
Current, a request to the API with rewrite rules enabled doesn't differentiate URLs with trailing slashes just as http://localhost:8080/wp-json/wp/v2/ vs http://localhost:8080/wp-json/wp/v2, this seems to be a property to WP_Rewrite / class WP to split off the trailing slash always.
However, when making requests do http://localhost:8080/?rest_route=/wp/v2/ the trailing slash is not stripped, as it doesn't go through the same transformation in class WP. I think it's safe to always untrailingslash the requested URL in the REST API, for matching purposes.
Change History (6)
- Keywords has-patch added
- Owner set to rmccue
- Status changed from new to reviewing