Commit Graph

67 Commits

Author SHA1 Message Date
Fatih Kadir Akın ce1f595c5d Remove param parsing with regex since Radix has state-machine implementation which is a way faster 2016-01-25 22:52:41 +02:00
Sdogruyol 788c7241d4 Handle cases when logger can be nil 2016-01-18 17:25:52 +02:00
sdogruyol 4c423e967f Refactor parse_url_params 2016-01-13 10:07:37 +02:00
Fatih Kadir Akın 3e8b2ae51c Implement parse_url_params 2016-01-13 00:06:19 +02:00
Sdogruyol 0b4a36953f Started reimplementing router 2016-01-12 21:37:12 +02:00
sdogruyol 211685ee74 Fix basic_auth 2015-12-31 14:03:11 +02:00
Alfonso Uceda Pompa 8c0ea21d44 return raw json when we parse the request body 2015-12-24 17:09:33 +01:00
Imran Latif c42f1f88e9 Added support for magic param `_method` just like Rails, Sinatra.
Following are the changes made in this commit:

- Added support for magic param `_method` just like Rails, Sinatra
etc.. Browsers which don't support `PUT`, `PATCH` and `DELETE` methods
can simulate them by sending `method` param in request body.

- The default Content-Type to parse request body submitted via forms
etc. is `application/x-www-form-urlencoded`. But if we send Ajax
request in Chrome ($.post) then by-default Content-Type is set to
`application/x-www-form-urlencoded; charset utf-8` which was not
getting matched. I changed the code from `==` to match against a
regular expression using `=~`.

- Print name and color of overridden HTTP method via Logger instead of
printing name and color or request's incoming HTTP method.

Making necessary changes as pointed by @sdogruyol

- Changed method name from`is_override_method_valid?` to
`override_method_valid?`.

- Refactored `if` condition in `override_method_valid?`.
2015-12-03 01:34:16 +05:00
Aşkın Gedik 51708ce8e7 parse request body for array 2015-11-10 13:30:16 +02:00
Micah Geisel dea9b2f663 application/json GETs can have no request body. 2015-11-09 16:35:28 -08:00
Sdogruyol 3687897005 Added JSON body parsing 2015-11-06 20:24:38 +02:00
Oleksii Fedorov f658fbe8af Parse request body params only if content type is application/x-www-form-urlencoded 2015-11-05 11:38:06 +01:00
Sdogruyol 5892d900ff Added documentation for context, param_parser and route 2015-10-29 17:16:29 +02:00
Sdogruyol 2cbe54b624 Fixed samples url 2015-10-29 11:22:44 +02:00
Sdogruyol 924905f146 Convert parse_request to macro 2015-10-28 22:04:05 +02:00
Sdogruyol ad6baba12b Added param_parser specs 2015-10-28 20:38:24 +02:00
Sdogruyol 3cc50e0a7e Added param parser 2015-10-28 20:30:27 +02:00