summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd.erl2
-rw-r--r--src/couchdb/couch_util.erl9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 9ad39e2d..7b876cfa 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -375,7 +375,7 @@ log_request(#httpd{mochi_req=MochiReq,peer=Peer,method=Method}, Code) ->
Peer,
Method,
MochiReq:get(raw_path),
- Code
+ couch_util:to_integer(Code)
]).
diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl
index 7efc07c0..cdae0d4a 100644
--- a/src/couchdb/couch_util.erl
+++ b/src/couchdb/couch_util.erl
@@ -19,7 +19,7 @@
-export([encodeBase64/1, decodeBase64/1, encodeBase64Url/1, decodeBase64Url/1,
to_hex/1,parse_term/1, dict_find/3]).
-export([file_read_size/1, get_nested_json_value/2, json_user_ctx/1]).
--export([to_binary/1, to_list/1, url_encode/1]).
+-export([to_binary/1, to_integer/1, to_list/1, url_encode/1]).
-include("couch_db.hrl").
-include_lib("kernel/include/file.hrl").
@@ -371,6 +371,13 @@ to_binary(V) when is_atom(V) ->
to_binary(V) ->
list_to_binary(io_lib:format("~p", [V])).
+to_integer(V) when is_integer(V) ->
+ V;
+to_integer(V) when is_list(V) ->
+ erlang:list_to_integer(V);
+to_integer(V) when is_binary(V) ->
+ erlang:list_to_integer(binary_to_list(V)).
+
to_list(V) when is_list(V) ->
V;
to_list(V) when is_binary(V) ->