24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-10 21:47:01 +02:00

* src/web/ejabberd_http.erl: Bugfix

SVN Revision: 269
This commit is contained in:
Alexey Shchepin 2004-09-29 14:09:02 +00:00
parent f17f0dac12
commit 0e2af703bd
2 changed files with 50 additions and 39 deletions

View File

@ -1,3 +1,7 @@
2004-09-29 Alexey Shchepin <alexey@sevcom.net>
* src/web/ejabberd_http.erl: Bugfix
2004-09-27 Alexey Shchepin <alexey@sevcom.net> 2004-09-27 Alexey Shchepin <alexey@sevcom.net>
* src/Makefile.in: Updated (thanks to Badlop) * src/Makefile.in: Updated (thanks to Badlop)

View File

@ -200,25 +200,29 @@ process_request(#state{request_method = 'GET',
{'EXIT', _} -> {'EXIT', _} ->
process_request(false); process_request(false);
{NPath, Query} -> {NPath, Query} ->
LQuery = parse_urlencoded(Query), case (catch parse_urlencoded(Query)) of
LPath = string:tokens(NPath, "/"), {'EXIT', _Reason} ->
Request = #request{method = 'GET', process_request(false);
path = LPath, LQuery ->
q = LQuery, LPath = string:tokens(NPath, "/"),
user = User, Request = #request{method = 'GET',
lang = Lang}, path = LPath,
case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin}, q = LQuery,
Request) of user = User,
El when element(1, El) == xmlelement -> lang = Lang},
make_xhtml_output(200, [], El); case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin},
{Status, Headers, El} when Request) of
element(1, El) == xmlelement -> El when element(1, El) == xmlelement ->
make_xhtml_output(Status, Headers, El); make_xhtml_output(200, [], El);
Text when is_list(Text) -> {Status, Headers, El} when
make_text_output(200, [], Text); element(1, El) == xmlelement ->
{Status, Headers, Text} when make_xhtml_output(Status, Headers, El);
is_list(Text) -> Text when is_list(Text) ->
make_text_output(Status, Headers, Text) make_text_output(200, [], Text);
{Status, Headers, Text} when
is_list(Text) ->
make_text_output(Status, Headers, Text)
end
end end
end end
end; end;
@ -265,30 +269,33 @@ process_request(#state{request_method = 'POST',
process_request(false); process_request(false);
{NPath, Query} -> {NPath, Query} ->
LPath = string:tokens(NPath, "/"), LPath = string:tokens(NPath, "/"),
LQuery = parse_urlencoded(Data), case (catch parse_urlencoded(Data)) of
Request = #request{method = 'POST', {'EXIT', _Reason} ->
path = LPath, process_request(false);
q = LQuery, LQuery ->
user = User, Request = #request{method = 'POST',
data = Data, path = LPath,
lang = Lang}, q = LQuery,
case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin}, user = User,
Request) of data = Data,
El when element(1, El) == xmlelement -> lang = Lang},
make_xhtml_output(200, [], El); case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin},
{Status, Headers, El} when Request) of
element(1, El) == xmlelement -> El when element(1, El) == xmlelement ->
make_xhtml_output(Status, Headers, El); make_xhtml_output(200, [], El);
Text when is_list(Text) -> {Status, Headers, El} when
make_text_output(200, [], Text); element(1, El) == xmlelement ->
{Status, Headers, Text} when make_xhtml_output(Status, Headers, El);
is_list(Text) -> Text when is_list(Text) ->
make_text_output(Status, Headers, Text) make_text_output(200, [], Text);
{Status, Headers, Text} when is_list(Text) ->
make_text_output(Status, Headers, Text)
end
end end
end end
end; end;
process_request(State) -> process_request(_) ->
make_xhtml_output( make_xhtml_output(
400, 400,
[], [],