From: Paweł Chmielowski Date: Wed, 23 May 2018 12:52:47 +0000 (+0200) Subject: Handle "Expect: 100-continue" request header in ejabberd_http X-Git-Tag: 18.06~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97f7d990075bd84931595cd5027632c40ddc8da9;p=ejabberd Handle "Expect: 100-continue" request header in ejabberd_http --- diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index e3cba3d95..7afe1ce55 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -462,6 +462,7 @@ process_request(#state{request_host = undefined, process_request(#state{request_method = Method, request_auth = Auth, request_lang = Lang, + request_version = Version, sockmod = SockMod, socket = Socket, options = Options, @@ -472,6 +473,12 @@ process_request(#state{request_method = Method, request_headers = RequestHeaders, request_handlers = RequestHandlers, custom_headers = CustomHeaders} = State) -> + case proplists:get_value(<<"Expect">>, RequestHeaders, <<>>) of + <<"100-", _/binary>> when Version == {1, 1} -> + send_text(State, <<"HTTP/1.1 100 Continue\r\n\r\n">>); + _ -> + ok + end, case extract_path_query(State) of {State2, false} -> {State2, make_bad_request(State)};