diff --git a/lib/remote/httpconnection.cpp b/lib/remote/httpconnection.cpp
index 20fdee631..59bdb730d 100644
--- a/lib/remote/httpconnection.cpp
+++ b/lib/remote/httpconnection.cpp
@@ -91,7 +91,7 @@ bool HttpConnection::ProcessMessage(void)
response.SetStatus(400, "Bad request");
String msg = "
Bad request
";
response.WriteBody(msg.CStr(), msg.GetLength());
- response.FinishBody();
+ response.Finish();
m_Stream->Shutdown();
return false;
diff --git a/lib/remote/httphandler.cpp b/lib/remote/httphandler.cpp
index 8c0802297..51bffc80e 100644
--- a/lib/remote/httphandler.cpp
+++ b/lib/remote/httphandler.cpp
@@ -90,7 +90,7 @@ void HttpHandler::ProcessRequest(HttpRequest& request, HttpResponse& response)
response.SetStatus(404, "Not found");
String msg = "Not found
";
response.WriteBody(msg.CStr(), msg.GetLength());
- response.FinishBody();
+ response.Finish();
return;
}