]> granicus.if.org Git - ejabberd/commitdiff
Log an error if HTTP request does not include Host header (EJAB-966)
authorBadlop <badlop@process-one.net>
Thu, 23 Jul 2009 14:50:58 +0000 (14:50 +0000)
committerBadlop <badlop@process-one.net>
Thu, 23 Jul 2009 14:50:58 +0000 (14:50 +0000)
SVN Revision: 2386

src/web/ejabberd_http.erl

index 8eec261ce2da960916344695f47da367d083b3b8..bed6c28ac1cc97ff90d2a81d1b8be42f31b27d7e 100644 (file)
@@ -235,6 +235,9 @@ process_header(State, Data) ->
                        request_headers=add_header(Name, Host, State)};
        {ok, {http_header, _, Name, _, Value}} ->
            State#state{request_headers=add_header(Name, Value, State)};
+       {ok, http_eoh} when State#state.request_host == undefined ->
+           ?WARNING_MSG("An HTTP request without 'Host' HTTP header was received.", []),
+           throw(http_request_no_host_header);
        {ok, http_eoh} ->
            ?DEBUG("(~w) http query: ~w ~s~n",
                   [State#state.socket,