aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2009-07-23 14:50:58 +0000
committerBadlop <badlop@process-one.net>2009-07-23 14:50:58 +0000
commitb3eb800be183a844a4e70ca7ba2d757bbb831724 (patch)
tree31c55014c2c01667d3704af15a625f6247531240 /src
parentdelete/2 now does not crash when there is nothing to delete. fold/1 added (diff)
Log an error if HTTP request does not include Host header (EJAB-966)
SVN Revision: 2386
Diffstat (limited to 'src')
-rw-r--r--src/web/ejabberd_http.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl
index 8eec261ce..bed6c28ac 100644
--- a/src/web/ejabberd_http.erl
+++ b/src/web/ejabberd_http.erl
@@ -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,