2008-06-21 Badlop <badlop@process-one.net>
- * doc/guide.tex: Explain that S2S outgoing first tries IPV4 and if
+ * src/web/ejabberd_http.erl: Support PUT and DELETE methods in
+ ejabberd_http (thanks to Eric Cestari)(EJAB-662)
+
+ * doc/guide.tex: Explain that S2S outgoing first tries IPv4 and if
that fails then tries IPv6
* doc/guide.html: Likewise
process(HandlersLeft, Request)
end.
-process_request(#state{request_method = 'GET',
+process_request(#state{request_method = Method,
request_path = {abs_path, Path},
request_auth = Auth,
request_lang = Lang,
request_handlers = RequestHandlers,
sockmod = SockMod,
- socket = Socket} = State) ->
+ socket = Socket} = State)
+ when Method=:='GET' orelse Method=:='HEAD' orelse Method=:='DELETE' ->
case (catch url_decode_q_split(Path)) of
{'EXIT', _} ->
process_request(false);
_ ->
SockMod:peername(Socket)
end,
- Request = #request{method = 'GET',
+ Request = #request{method = Method,
path = LPath,
q = LQuery,
auth = Auth,
end
end;
-process_request(#state{request_method = 'POST',
+process_request(#state{request_method = Method,
request_path = {abs_path, Path},
request_auth = Auth,
request_content_length = Len,
sockmod = SockMod,
socket = Socket,
request_handlers = RequestHandlers} = State)
- when is_integer(Len) ->
+ when (Method=:='POST' orelse Method=:='PUT') andalso is_integer(Len) ->
case SockMod of
gen_tcp ->
inet:setopts(Socket, [{packet, 0}]);
LQ ->
LQ
end,
- Request = #request{method = 'POST',
+ Request = #request{method = Method,
path = LPath,
q = LQuery,
auth = Auth,