treefrogframework/treefrog-framework — pull request #20 by axos88 (2014-03-07 12:35:49+00:00)
Title: V1.7.5 plus

Please review my changes carefully. Will recommend reviewing commit by commit, and using ?w=1 parameter to avoid seeing indentation changes as additions/removals.

!!As I could not get master running correctly on my machine, I worked on top of 1.7.5.
Will probably need some merging and conflict resolution, sorry!.

My pull request:

- fixes routing errors (a get or post route would accept any http verb, even invalid ones, not only the get and post). Same for match
- added support for put, patch, delete routes and http verbs
- when adding a rule both /rule and /rule/ was added to the routing list, removed that doubling and now appending the '/' when the incoming requests don't have it.
- fixes a debug output message
- now returning 404 instead of 400 in some cases when there is no actual route match.

Todo:
update documentation about support for put, patch, delete

Further work (probably an incoming request in a few days):
- Rails-like support for put, patch, delete. Browsers are incapable of sending anything other than get and post. Rails overcame this shortcoming by reserving the "method" parameter, and when present overriding the incoming verb with it.