diff options
author | Magnus Klaar <[email protected]> | 2011-12-05 01:08:38 +0100 |
---|---|---|
committer | Magnus Klaar <[email protected]> | 2011-12-07 19:02:10 +0100 |
commit | c747efbd7533c3b4dd7caa267070c36608c4c0d2 (patch) | |
tree | eef8cf0ca68d0ed63229b013160a2dac8e77bf2e /include | |
parent | a12a910341dd22bd27096b50edf3d9820bc90384 (diff) | |
download | cowboy-c747efbd7533c3b4dd7caa267070c36608c4c0d2.tar.gz cowboy-c747efbd7533c3b4dd7caa267070c36608c4c0d2.tar.bz2 cowboy-c747efbd7533c3b4dd7caa267070c36608c4c0d2.zip |
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.
Diffstat (limited to 'include')
-rw-r--r-- | include/http.hrl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/http.hrl b/include/http.hrl index d1ca0aa..fd0eecc 100644 --- a/include/http.hrl +++ b/include/http.hrl @@ -68,5 +68,8 @@ %% Response. resp_state = waiting :: locked | waiting | chunks | done, resp_headers = [] :: http_headers(), - resp_body = <<>> :: binary() + resp_body = <<>> :: binary(), + + %% Functions. + urldecode :: {fun((binary(), T) -> binary()), T} }). |