diff options
author | Linus Nordberg <linus@nordberg.se> | 2014-09-15 12:36:52 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2014-09-15 12:36:52 +0200 |
commit | 12715ccde9c3e3006019f940c8bfdb1ebd4476ff (patch) | |
tree | e6b35bf9854e261935fdf2d1c720d71de7b30949 | |
parent | 60218ccea446cf4fd56d55d4a9e5a6a9dab20fc6 (diff) |
Don't try to JSON-encode error messages.
-rw-r--r-- | src/v1.erl | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -56,14 +56,17 @@ {First, _} = string:to_integer(FirstInput), {Second, _} = string:to_integer(SecondInput), case lists:member(error, [First, Second]) of - true -> html("get-sth-consistency: bad input:", - [First, Second]); - _ -> [base64:encode(X) || - X <- plop:consistency(First, Second)] + true -> + html("get-sth-consistency: bad input:", [First, Second]); + _ -> + binary_to_list( + jiffy:encode( + [base64:encode(X) || + X <- plop:consistency(First, Second)])) end; _ -> html("get-sth-consistency: bad input:", Input) end, - deliver(SessionID, binary_to_list(jiffy:encode(R))). + deliver(SessionID, (R)). 'get-proof-by-hash'(SessionID, _Env, _Input) -> niy(SessionID). 'get-entries'(SessionID, _Env, Input) -> |