From c747efbd7533c3b4dd7caa267070c36608c4c0d2 Mon Sep 17 00:00:00 2001 From: Magnus Klaar Date: Mon, 5 Dec 2011 01:08:38 +0100 Subject: replace quoted:from_url with cowboy_http:urldecode This change makes the dependency on quoted optional by adding a minimal urldecode function to cowboy. A protocol option for setting the urldecoding function has been added to the cowboy_http_protocol module. The default value for this option is set to be equivalent to the default settings for quoted. {fun cowboy_http:urldecode/2, crash} A note has been added in the README to document how to use quoted instead of this function. A field to store this option value has been added to the state record in the cowboy_http_protocol module and the http_req record in include/http.hrl Functions that previously used quoted:from_url/1 has been updated to require an equivalent function in addition to the previously required arguments. This change removes a C compiler from the build requirements of cowboy. It also removes the requirement to cross compile the code if the target arch/OS is different from the arch/OS used to build it. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2e5edcb..c297790 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,14 @@ handle(Req, State) -> terminate(Req, State) -> ok. ``` +**Note**: versions prior to `0.4.0` used the +[quoted](https://github.com/klaar/quoted.erl) library instead of the built in +`cowboy_http:urldecode/2` function. If you want to retain this you must add it +as a dependency to your application and add the following cowboy_http_protocol +option: + + {urldecode, {fun quoted:from_url/2, quoted:make([])}} + Continue reading to learn how to dispatch rules and handle requests. -- cgit v1.2.3