Open Misiu opened 4 years ago
Here is a test showing the differences: https://github.com/tuupola/slim-basepath
Apparently this is expected behaviour with Slim 4: https://github.com/slimphp/Slim/issues/2898. I will think about possible workarounds.
@tuupola I think it's worth mentioning that this is the behavior of the PSR-7 implementation itself, not Slim 4 per se. So far as per your tests Slim-Psr7 and Nyholm/Psr7 have the same behavior. I'm not sure about Guzzle and Zend though.
True, I will also test with Expressive to see how it works.
I have Slim 4 app that is deployed into a subfolder and called like so:
https://subdomain.example.com/api/foo
Inside my code I have this line:
$app->setBasePath("/api");
According to the docs
path
andignore
shouldn't include basepath. But this doesn't work:After adding basepath like below the code works:
There are some differences between Slim 3 and Slim 4 according to @tuupola comment here