slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

NotFound handler is using non Psr-7 method #1420

Closed ppetermann closed 9 years ago

ppetermann commented 9 years ago

I'm trying to use Slim 3.0-beta1 as a middleware, and it turns out, the default notFound page is not standard conform, as it uses a method named "getBasePath" which is not consistent with Psr\Http\Message\UriInterface (which should be returned by $request->getUri())

https://github.com/slimphp/Slim/blob/3.x/Slim/Handlers/NotFound.php#L62

silentworks commented 9 years ago

We should fix that actually, will have a look during this week to see if we can find a better solution.

akrabat commented 9 years ago

From our point of view, the complexity is in the basePath handling of our Uri that isn't part of PSR-7. The simplest solution is to use __toString() with the relevant parts cleared out.

silentworks commented 9 years ago

This should be fixed now.