]> granicus.if.org Git - ejabberd/commitdiff
* src/web/ejabberd_http.erl: Bugfix
authorAlexey Shchepin <alexey@process-one.net>
Wed, 29 Sep 2004 14:09:02 +0000 (14:09 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Wed, 29 Sep 2004 14:09:02 +0000 (14:09 +0000)
SVN Revision: 269

ChangeLog
src/web/ejabberd_http.erl

index 2046af3b05f0c5170d212674347490f9e6d9ce1c..29360fe33071388173944e2100c86f3920fc8d6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * src/Makefile.in: Updated (thanks to Badlop)
index ed66e0a9274dd0183d360490a5cbd1916b5db32e..70e2d36d2ac6f78e45dbebd5856170b1a31b4b50 100644 (file)
@@ -200,25 +200,29 @@ process_request(#state{request_method = 'GET',
                {'EXIT', _} ->
                    process_request(false);
                {NPath, Query} ->
-                   LQuery = parse_urlencoded(Query),
-                   LPath = string:tokens(NPath, "/"),
-                   Request = #request{method = 'GET',
-                                      path = LPath,
-                                      q = LQuery,
-                                      user = User,
-                                      lang = Lang},
-                   case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin},
-                                                 Request) of
-                       El when element(1, El) == xmlelement ->
-                           make_xhtml_output(200, [], El);
-                       {Status, Headers, El} when
-                             element(1, El) == xmlelement ->
-                           make_xhtml_output(Status, Headers, El);
-                       Text when is_list(Text) ->
-                           make_text_output(200, [], Text);
-                       {Status, Headers, Text} when
-                             is_list(Text) ->
-                           make_text_output(Status, Headers, Text)
+                   case (catch parse_urlencoded(Query)) of
+                       {'EXIT', _Reason} ->
+                           process_request(false);
+                       LQuery ->
+                           LPath = string:tokens(NPath, "/"),
+                           Request = #request{method = 'GET',
+                                              path = LPath,
+                                              q = LQuery,
+                                              user = User,
+                                              lang = Lang},
+                           case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin},
+                                                         Request) of
+                               El when element(1, El) == xmlelement ->
+                                   make_xhtml_output(200, [], El);
+                               {Status, Headers, El} when
+                                     element(1, El) == xmlelement ->
+                                   make_xhtml_output(Status, Headers, El);
+                               Text when is_list(Text) ->
+                                   make_text_output(200, [], Text);
+                               {Status, Headers, Text} when
+                                     is_list(Text) ->
+                                   make_text_output(Status, Headers, Text)
+                           end
                    end
            end
     end;
@@ -265,30 +269,33 @@ process_request(#state{request_method = 'POST',
                    process_request(false);
                {NPath, Query} ->
                    LPath = string:tokens(NPath, "/"),
-                   LQuery = parse_urlencoded(Data),
-                   Request = #request{method = 'POST',
-                                      path = LPath,
-                                      q = LQuery,
-                                      user = User,
-                                      data = Data,
-                                      lang = Lang},
-                   case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin},
-                                                 Request) of
-                       El when element(1, El) == xmlelement ->
-                           make_xhtml_output(200, [], El);
-                       {Status, Headers, El} when
-                             element(1, El) == xmlelement ->
-                           make_xhtml_output(Status, Headers, El);
-                       Text when is_list(Text) ->
-                           make_text_output(200, [], Text);
-                       {Status, Headers, Text} when
-                             is_list(Text) ->
-                           make_text_output(Status, Headers, Text)
+                   case (catch parse_urlencoded(Data)) of
+                       {'EXIT', _Reason} ->
+                           process_request(false);
+                       LQuery ->
+                           Request = #request{method = 'POST',
+                                              path = LPath,
+                                              q = LQuery,
+                                              user = User,
+                                              data = Data,
+                                              lang = Lang},
+                           case ejabberd_web:process_get({UseHTTPPoll, UseWebAdmin},
+                                                         Request) of
+                               El when element(1, El) == xmlelement ->
+                                   make_xhtml_output(200, [], El);
+                               {Status, Headers, El} when
+                                     element(1, El) == xmlelement ->
+                                   make_xhtml_output(Status, Headers, El);
+                               Text when is_list(Text) ->
+                                   make_text_output(200, [], Text);
+                               {Status, Headers, Text} when is_list(Text) ->
+                                   make_text_output(Status, Headers, Text)
+                           end
                    end
            end
     end;
 
-process_request(State) ->
+process_request(_) ->
     make_xhtml_output(
       400,
       [],