mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Throw a meaningful error when the URL can't be parsed
This commit is contained in:
parent
3f68689367
commit
3ee28ef7cc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user