diff options
Diffstat (limited to 'src/HTTP/HTTPServerConnection.cpp')
-rw-r--r-- | src/HTTP/HTTPServerConnection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/HTTP/HTTPServerConnection.cpp b/src/HTTP/HTTPServerConnection.cpp index df9c0970a..f79f08517 100644 --- a/src/HTTP/HTTPServerConnection.cpp +++ b/src/HTTP/HTTPServerConnection.cpp @@ -30,8 +30,8 @@ cHTTPServerConnection::~cHTTPServerConnection() = default; void cHTTPServerConnection::SendStatusAndReason(int a_StatusCode, const AString & a_Response) { - SendData(Printf("HTTP/1.1 %d %s\r\n", a_StatusCode, a_Response.c_str())); - SendData(Printf("Content-Length: %u\r\n\r\n", static_cast<unsigned>(a_Response.size()))); + SendData(fmt::format(FMT_STRING("HTTP/1.1 {} {}\r\n"), a_StatusCode, a_Response)); + SendData(fmt::format(FMT_STRING("Content-Length: {}\r\n\r\n"), a_Response)); SendData(a_Response.data(), a_Response.size()); m_CurrentRequest.reset(); m_Parser.Reset(); @@ -43,7 +43,7 @@ void cHTTPServerConnection::SendStatusAndReason(int a_StatusCode, const AString void cHTTPServerConnection::SendNeedAuth(const AString & a_Realm) { - SendData(Printf("HTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: Basic realm=\"%s\"\r\nContent-Length: 0\r\n\r\n", a_Realm.c_str())); + SendData(fmt::format(FMT_STRING("HTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: Basic realm=\"{}\"\r\nContent-Length: 0\r\n\r\n"), a_Realm)); m_CurrentRequest.reset(); m_Parser.Reset(); } |