aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-04-30 22:24:52 +0200
committerLoïc Hoguin <[email protected]>2012-04-30 22:24:52 +0200
commit48a2b177f587c742c30428e4319075fdc12157b7 (patch)
tree8e2b4e48361681cad25042ba85a22187ec452154 /src/cowboy_http.erl
parentbc2d53d2a5e865ce36a0419c4d4698b30359415b (diff)
parentee8c50c5ab97dcaebc8932d093741fdb496e00f7 (diff)
downloadcowboy-48a2b177f587c742c30428e4319075fdc12157b7.tar.gz
cowboy-48a2b177f587c742c30428e4319075fdc12157b7.tar.bz2
cowboy-48a2b177f587c742c30428e4319075fdc12157b7.zip
Merge branch 'cowboy-client'
Diffstat (limited to 'src/cowboy_http.erl')
-rw-r--r--src/cowboy_http.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index 2f4f982..0289ef3 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -26,7 +26,8 @@
-export([te_chunked/2, te_identity/2, ce_identity/1]).
%% Interpretation.
--export([connection_to_atom/1, urldecode/1, urldecode/2, urlencode/1,
+-export([connection_to_atom/1, version_to_binary/1,
+ urldecode/1, urldecode/2, urlencode/1,
urlencode/2, x_www_form_urlencoded/2]).
-type method() :: 'OPTIONS' | 'GET' | 'HEAD'
@@ -773,6 +774,11 @@ connection_to_atom([<<"close">>|_Tail]) ->
connection_to_atom([_Any|Tail]) ->
connection_to_atom(Tail).
+%% @doc Convert an HTTP version tuple to its binary form.
+-spec version_to_binary(version()) -> binary().
+version_to_binary({1, 1}) -> <<"HTTP/1.1">>;
+version_to_binary({1, 0}) -> <<"HTTP/1.0">>.
+
%% @doc Decode a URL encoded binary.
%% @equiv urldecode(Bin, crash)
-spec urldecode(binary()) -> binary().