summaryrefslogtreecommitdiff
path: root/src/mochiweb/mochiweb_util.erl
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-02-24 22:10:04 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-02-24 22:10:04 +0000
commit1ba7a12c72cfb645c36187bbb95ea9160c8a3284 (patch)
tree1b8ca4890d737ce9ceb9c0927b11659666193d33 /src/mochiweb/mochiweb_util.erl
parent47895d920228edfb195e62ff04d5aa8ef667ed5b (diff)
Update MochiWeb in trunk to r97. Closes COUCHDB-255.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@747575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/mochiweb/mochiweb_util.erl')
-rw-r--r--src/mochiweb/mochiweb_util.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mochiweb/mochiweb_util.erl b/src/mochiweb/mochiweb_util.erl
index 63d0b986..9a0675f5 100644
--- a/src/mochiweb/mochiweb_util.erl
+++ b/src/mochiweb/mochiweb_util.erl
@@ -134,12 +134,16 @@ revjoin([S | Rest], Separator, []) ->
revjoin([S | Rest], Separator, Acc) ->
revjoin(Rest, Separator, [S, Separator | Acc]).
-%% @spec quote_plus(atom() | integer() | string()) -> string()
+%% @spec quote_plus(atom() | integer() | float() | string() | binary()) -> string()
%% @doc URL safe encoding of the given term.
quote_plus(Atom) when is_atom(Atom) ->
quote_plus(atom_to_list(Atom));
quote_plus(Int) when is_integer(Int) ->
quote_plus(integer_to_list(Int));
+quote_plus(Binary) when is_binary(Binary) ->
+ quote_plus(binary_to_list(Binary));
+quote_plus(Float) when is_float(Float) ->
+ quote_plus(mochinum:digits(Float));
quote_plus(String) ->
quote_plus(String, []).
@@ -542,6 +546,7 @@ test_join() ->
test_quote_plus() ->
"foo" = quote_plus(foo),
"1" = quote_plus(1),
+ "1.1" = quote_plus(1.1),
"foo" = quote_plus("foo"),
"foo+bar" = quote_plus("foo bar"),
"foo%0A" = quote_plus("foo\n"),