aboutsummaryrefslogtreecommitdiff
path: root/src/web/mod_http_bind.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/mod_http_bind.erl')
-rw-r--r--src/web/mod_http_bind.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/web/mod_http_bind.erl b/src/web/mod_http_bind.erl
index d913c6d84..bbaeae6c6 100644
--- a/src/web/mod_http_bind.erl
+++ b/src/web/mod_http_bind.erl
@@ -48,6 +48,7 @@
-include("ejabberd.hrl").
-include("jlib.hrl").
-include("ejabberd_http.hrl").
+-include("http_bind.hrl").
%% Duplicated from ejabberd_http_bind.
%% TODO: move to hrl file.
@@ -60,8 +61,8 @@
process([], #request{method = 'POST',
data = []}) ->
?DEBUG("Bad Request: no data", []),
- {400, [], {xmlelement, "h1", [],
- [{xmlcdata, "400 Bad Request"}]}};
+ {400, ?HEADER, {xmlelement, "h1", [],
+ [{xmlcdata, "400 Bad Request"}]}};
process([], #request{method = 'POST',
data = Data,
ip = IP}) ->
@@ -69,11 +70,14 @@ process([], #request{method = 'POST',
ejabberd_http_bind:process_request(Data, IP);
process([], #request{method = 'GET',
data = []}) ->
- get_human_html_xmlel();
+ {200, ?HEADER, get_human_html_xmlel()};
+process([], #request{method = 'OPTIONS',
+ data = []}) ->
+ {200, ?OPTIONS_HEADER, []};
process(_Path, _Request) ->
?DEBUG("Bad Request: ~p", [_Request]),
- {400, [], {xmlelement, "h1", [],
- [{xmlcdata, "400 Bad Request"}]}}.
+ {400, ?HEADER, {xmlelement, "h1", [],
+ [{xmlcdata, "400 Bad Request"}]}}.
get_human_html_xmlel() ->
Heading = "ejabberd " ++ atom_to_list(?MODULE) ++ " v" ++ ?MOD_HTTP_BIND_VERSION,