~ubuntu-branches/ubuntu/trusty/ejabberd/trusty-proposed

« back to all changes in this revision

Viewing changes to src/web/mod_http_bind.erl

  • Committer: Bazaar Package Importer
  • Author(s): Konstantin Khomoutov, Konstantin Khomoutov, Gerfried Fuchs
  • Date: 2010-04-06 13:00:03 UTC
  • mfrom: (1.1.14 upstream) (13.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100406130003-ub626hx26kgazp79
Tags: 2.1.3-1
[ Konstantin Khomoutov ]
* New upstream release.
* Remove obsolete c2s-p1-fsm.patch
* Remove obsolete ejabberdctl-help-dashes.patch
* Update mod_admin_extra to revision 1078
* Refresh shared_roster_recent.patch
* Refresh shared_roster_online.patch
* Clarify how to do mixed IPv4/IPv6 setup of ejabberd listeners
  as suggested by Marc Dequènes in the discussion of #573801.

[ Gerfried Fuchs ]
* Remove Torsten Werner from maintainer field on his own wish - thanks for
  your work so far! (closes: #578722)
* Promote Konstantin to Maintainer to best fit reality. Enjoy. :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
-include("ejabberd.hrl").
49
49
-include("jlib.hrl").
50
50
-include("ejabberd_http.hrl").
 
51
-include("http_bind.hrl").
51
52
 
52
53
%% Duplicated from ejabberd_http_bind.
53
54
%% TODO: move to hrl file.
60
61
process([], #request{method = 'POST',
61
62
                     data = []}) ->
62
63
    ?DEBUG("Bad Request: no data", []),
63
 
    {400, [], {xmlelement, "h1", [],
64
 
               [{xmlcdata, "400 Bad Request"}]}};
 
64
    {400, ?HEADER, {xmlelement, "h1", [],
 
65
                    [{xmlcdata, "400 Bad Request"}]}};
65
66
process([], #request{method = 'POST',
66
67
                     data = Data,
67
68
                     ip = IP}) ->
69
70
    ejabberd_http_bind:process_request(Data, IP);
70
71
process([], #request{method = 'GET',
71
72
                     data = []}) ->
72
 
    get_human_html_xmlel();
 
73
    {200, ?HEADER, get_human_html_xmlel()};
 
74
process([], #request{method = 'OPTIONS',
 
75
                     data = []}) ->
 
76
    {200, ?OPTIONS_HEADER, []};
73
77
process(_Path, _Request) ->
74
78
    ?DEBUG("Bad Request: ~p", [_Request]),
75
 
    {400, [], {xmlelement, "h1", [],
76
 
               [{xmlcdata, "400 Bad Request"}]}}.
 
79
    {400, ?HEADER, {xmlelement, "h1", [],
 
80
                    [{xmlcdata, "400 Bad Request"}]}}.
77
81
 
78
82
get_human_html_xmlel() ->
79
83
    Heading = "ejabberd " ++ atom_to_list(?MODULE) ++ " v" ++ ?MOD_HTTP_BIND_VERSION,