Handle "Expect: 100-continue" request header in ejabberd_http

This commit is contained in:
Paweł Chmielowski 2018-05-23 14:52:47 +02:00
parent 2bbfc0b79e
commit 97f7d99007
1 changed files with 7 additions and 0 deletions

View File

@ -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)};