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:
parent
3f68689367
commit
3ee28ef7cc
@ -350,8 +350,8 @@ process_request(#state{request_method = Method,
|
|||||||
socket = Socket} = State)
|
socket = Socket} = State)
|
||||||
when Method=:='GET' orelse Method=:='HEAD' orelse Method=:='DELETE' orelse Method=:='OPTIONS' ->
|
when Method=:='GET' orelse Method=:='HEAD' orelse Method=:='DELETE' orelse Method=:='OPTIONS' ->
|
||||||
case (catch url_decode_q_split(Path)) of
|
case (catch url_decode_q_split(Path)) of
|
||||||
{'EXIT', _} ->
|
{'EXIT', Error} ->
|
||||||
process_request(false);
|
throw({error_decoding_url, Path, Error});
|
||||||
{NPath, Query} ->
|
{NPath, Query} ->
|
||||||
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
|
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
|
||||||
LQuery = case (catch parse_urlencoded(Query)) of
|
LQuery = case (catch parse_urlencoded(Query)) of
|
||||||
@ -422,8 +422,8 @@ process_request(#state{request_method = Method,
|
|||||||
Data = recv_data(State, Len),
|
Data = recv_data(State, Len),
|
||||||
?DEBUG("client data: ~p~n", [Data]),
|
?DEBUG("client data: ~p~n", [Data]),
|
||||||
case (catch url_decode_q_split(Path)) of
|
case (catch url_decode_q_split(Path)) of
|
||||||
{'EXIT', _} ->
|
{'EXIT', Error} ->
|
||||||
process_request(false);
|
throw({error_decoding_url, Path, Error});
|
||||||
{NPath, _Query} ->
|
{NPath, _Query} ->
|
||||||
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
|
LPath = [path_decode(NPE) || NPE <- string:tokens(NPath, "/")],
|
||||||
LQuery = case (catch parse_urlencoded(Data)) of
|
LQuery = case (catch parse_urlencoded(Data)) of
|
||||||
|
Loading…
Reference in New Issue
Block a user