From 3ee28ef7cc5f3a719116908bcd4a5db251fc7a18 Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 21 Jun 2010 21:30:08 +0200 Subject: [PATCH] Throw a meaningful error when the URL can't be parsed --- src/web/ejabberd_http.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl index d9b76e1de..bdde5926e 100644 --- a/src/web/ejabberd_http.erl +++ b/src/web/ejabberd_http.erl @@ -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