25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Don't report Host mismatch as an error

This commit is contained in:
Evgeniy Khramtsov 2017-10-05 11:08:58 +03:00
parent f3af117108
commit 43e729293a

View File

@ -310,10 +310,10 @@ process(LocalPath, #request{host = Host, auth = Auth, headers = RHeaders} = Requ
add_to_log(FileSize, Code, Request#request{host = VHost}),
{Code, Headers, Contents}
catch _:{Why, _} when Why == noproc; Why == invalid_domain; Why == unregistered_route ->
?ERROR_MSG("Received an HTTP request with Host: ~s, "
"but couldn't find the related "
"ejabberd virtual host", [Host]),
ejabberd_web:error(not_found)
?DEBUG("Received an HTTP request with Host: ~s, "
"but couldn't find the related "
"ejabberd virtual host", [Host]),
?HTTP_ERR_FILE_NOT_FOUND
end.
serve(LocalPath, Auth, DocRoot, DirectoryIndices, CustomHeaders, DefaultContentType,