aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_router.erl
AgeCommit message (Collapse)Author
2014-11-07Rename 'halt' to 'stop' for better consistencyLoïc Hoguin
Now everywhere in Cowboy when we want to stop something we return a 'stop' tuple instead of one of the many choices depending on context that we had before. This particular change affects middlewares, sub protocols and REST handlers which were using 'halt' to stop processing.
2014-10-03Replace some /binary to /bits in binary pattern matchingLoïc Hoguin
We don't need the extra check for multiple of 8 bits.
2014-09-24Small tweak from erlang:error/1 to error/1Loïc Hoguin
2014-09-24Remove the error tuple return value for middlewaresLoïc Hoguin
It wasn't interesting compared to simply returning a halt tuple with an explicit reply.
2014-09-23Make routing constraints use the fields formatLoïc Hoguin
This makes routing more in line with the rest of Cowboy and allows us to use cowboy_constraints directly.
2014-09-23Breaking update of the cowboy_req interfaceLoïc Hoguin
Simplify the interface for most cowboy_req functions. They all return a single value except the four body reading functions. The reply functions now only return a Req value. Access functions do not return a Req anymore. Functions that used to cache results do not have a cache anymore. The interface for accessing query string and cookies has therefore been changed. There are now three query string functions: qs/1 provides access to the raw query string value; parse_qs/1 returns the query string as a list of key/values; match_qs/2 returns a map containing the values requested in the second argument, after applying constraints and default value. Similarly, there are two cookie functions: parse_cookies/1 and match_cookies/2. More match functions will be added in future commits. None of the functions return an error tuple anymore. It either works or crashes. Cowboy will attempt to provide an appropriate status code in the response of crashed handlers. As a result, the content decode function has its return value changed to a simple binary, and the body reading functions only return on success.
2014-03-26Remove outdated comments, all edoc, plus a few minor tweaksLoïc Hoguin
2014-03-25Make the latin1 cyrillic route tests work on R17+Loïc Hoguin
Instead of relying on the encoding of the file we now simply have list of numbers as they would be inside a latin1 file.
2014-03-10Remove cowboy_http:urldecode/1 and urlencode/1Loïc Hoguin
Use cow_qs:urldecode/1 and cow_qs:urlencode/1 instead
2014-02-06Update copyright yearsLoïc Hoguin
2013-11-08Clarify error msg for route lacking starting slashDanielle Sucher
2013-04-26Removed asserts from unit testsEgobrain
2013-03-24add iolist support to route_matchTristan Sloughter
2013-03-02Fix cowboy_router typesLoïc Hoguin
2013-02-27Fix an incorrect comment in cowboy_routerLoïc Hoguin
2013-01-25Do not transform URIs to UnicodeVladimir Dronnikov
2013-01-29If a binding is reused, we check that values are identicalLoïc Hoguin
This is more for consistency than anything.
2013-01-28Add the 'function' constraintLoïc Hoguin
2013-01-28Add the 'int' constraintLoïc Hoguin
2013-01-28New routingLoïc Hoguin
Ultimately few things change, it's mostly just a nicer syntax and slightly different expectations. The name of the value `dispatch` did not change, because the previous dispatch values will now fail if the code is not updated to using `cowboy_router:compile/1`. No constraints have been implemented in this commit.
2013-01-22Remove cowboy_dispatcherLoïc Hoguin
Types and code are moved to cowboy_router. The match/3 export from cowboy_dispatcher isn't available anymore as it is called internally.
2013-01-03Add middleware supportLoïc Hoguin
Middlewares allow customizing the request processing. All existing Cowboy project are incompatible with this commit. You need to change `{dispatch, Dispatch}` in the protocol options to `{env, [{dispatch, Dispatch}]}` to fix your code.