]> granicus.if.org Git - ejabberd/commitdiff
Log request in access.log even when Host doesn't match
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 5 Oct 2017 08:16:05 +0000 (11:16 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 5 Oct 2017 08:16:05 +0000 (11:16 +0300)
src/mod_http_fileserver.erl

index d9805c1a2ecfddcb7d366a81c95aa40ccc2abf91..a3a49eef06fbde79ee7f2f4d4cfd73ac1703d815 100644 (file)
@@ -313,7 +313,9 @@ 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]),
-           ?HTTP_ERR_FILE_NOT_FOUND
+           {FileSize1, Code1, Headers1, Contents1} = ?HTTP_ERR_FILE_NOT_FOUND,
+           add_to_log(FileSize1, Code1, Request),
+           {Code1, Headers1, Contents1}
     end.
 
 serve(LocalPath, Auth, DocRoot, DirectoryIndices, CustomHeaders, DefaultContentType,