jacwright / RestServer

A PHP REST server for providing a very light-weight REST API.
MIT License
510 stars 194 forks source link

Root dir has trailing slash if indexfile is in root #110

Open tyzoid opened 6 years ago

tyzoid commented 6 years ago

If attempting to configure an API prefix while the api handler file is in the webroot, the api prefix will fail to be removed from the request path, since the root will be set to '/'.

thus, getPath should add a leading slash before attempting to trim out rootPath.