aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mod_http_fileserver.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mod_http_fileserver.erl b/src/mod_http_fileserver.erl
index a3a49eef0..73423d6a7 100644
--- a/src/mod_http_fileserver.erl
+++ b/src/mod_http_fileserver.erl
@@ -66,6 +66,8 @@
{-1, 403, [], <<"Forbidden">>}).
-define(HTTP_ERR_REQUEST_AUTH,
{-1, 401, ?REQUEST_AUTH_HEADERS, <<"Unauthorized">>}).
+-define(HTTP_ERR_HOST_UNKNOWN,
+ {-1, 410, [], <<"Host unknown">>}).
-define(DEFAULT_CONTENT_TYPE,
<<"application/octet-stream">>).
@@ -313,8 +315,8 @@ process(LocalPath, #request{host = Host, auth = Auth, headers = RHeaders} = Requ
?DEBUG("Received an HTTP request with Host: ~s, "
"but couldn't find the related "
"ejabberd virtual host", [Host]),
- {FileSize1, Code1, Headers1, Contents1} = ?HTTP_ERR_FILE_NOT_FOUND,
- add_to_log(FileSize1, Code1, Request),
+ {FileSize1, Code1, Headers1, Contents1} = ?HTTP_ERR_HOST_UNKNOWN,
+ add_to_log(FileSize1, Code1, Request#request{host = ?MYNAME}),
{Code1, Headers1, Contents1}
end.