25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Throw a meaningful error when the URL can't be parsed

This commit is contained in:
Badlop 2010-06-21 21:30:08 +02:00
parent 3f68689367
commit 3ee28ef7cc

View File

@ -350,8 +350,8 @@ process_request(#state{request_method = Method,
socket = Socket} = State)
when Method=:='GET' orelse Method=:='HEAD' orelse Method=:='DELETE' orelse Method=:='OPTIONS' ->
case (catch url_decode_q_split(Path)) of
{'EXIT', _} ->
process_request(false);
{'EXIT', Error} ->
throw({error_decoding_url, Path, Error});
{NPath, Query} ->
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
LQuery = case (catch parse_urlencoded(Query)) of
@ -422,8 +422,8 @@ process_request(#state{request_method = Method,
Data = recv_data(State, Len),
?DEBUG("client data: ~p~n", [Data]),
case (catch url_decode_q_split(Path)) of
{'EXIT', _} ->
process_request(false);
{'EXIT', Error} ->
throw({error_decoding_url, Path, Error});
{NPath, _Query} ->
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
LQuery = case (catch parse_urlencoded(Data)) of