f3-factory / fatfree-core

Fat-Free Framework core library
GNU General Public License v3.0
207 stars 88 forks source link

Routing Bug on PHP Built-in Development Server #267

Closed chez14 closed 5 years ago

chez14 commented 5 years ago

I made a Boilerplate for API project (here's the link: https://github.com/chez14/f3-api). I started to create a simple development server to see if i made a mistake somewhere, since PHP Built-in Dev Server is verbose enough to give me good insight of mess i created.

The problem is, if i wanted to add an extension to the url, like

GET /@module/@func.@extension=Controller\@module->get_@func

The built-in dev server will think that i'm trying to get a static file, instead of forwarding the request to index.php. Therefore i created a router file, to filter out the intended extensions for index.php proccess.

This works really well, when i access random jpg files, it can give me the correct path to it. But when i tried using the ".xml" or ".json" extension, the routing it self got messed up, and shows error 404.

The current bug behavior is by accessing /app/ping.xml will be interpreted as /ping.xml, hence it shows 404. I've tried using Apache server, and it works as expected (not showing any bug).

Am i doing something wrong in my routing file or is it should be fine as is?

xfra35 commented 5 years ago

Hi, have you tried the solution described in this SO post?

PS: please use the F3 Google Group for usage questions. This issue tracker is intended for bugs.

chez14 commented 5 years ago

Thank you for the support. I thought that it was a bug, so i made an issue. And no, i was not be able to find those SO post until now. Thanks again.