diff options
-rw-r--r-- | src/v1.erl | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -97,15 +97,14 @@ deliver(SessionID, R). 'get-entries'(SessionID, _Env, Input) -> - %% TODO: Limit the number of returned entries (i.e. start-end) to - %% something reasonable. R = case lists:sort(httpd:parse_query(Input)) of [{"end", EndInput}, {"start", StartInput}] -> {Start, _} = string:to_integer(StartInput), {End, _} = string:to_integer(EndInput), case lists:member(error, [Start, End]) of true -> html("get-entries: bad input:", [Start, End]); - false -> catlfish:entries(Start, End) + false -> catlfish:entries(Start, + min(max(End, Start), Start + 999)) end; _ -> html("get-entries: bad input:", Input) end, |