Skip to content

Commit

Permalink
feat(writeTOCLient): add response messag to the terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
dantol29 committed May 22, 2024
1 parent 34f26b1 commit e9ad2b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ void Server::writeToClient(Connection &conn, size_t &i, HTTPResponse &response)
{
tmpBufferSize = conn.getResponseString().size();
Debug::log("Sending last part of the response", Debug::NORMAL);
if (conn.getResponse().getStatusCode() < 300)
std::cout << GREEN << conn.getRequest().getMethod() << " " << conn.getResponse().getStatusCode() << " " << \
conn.getResponse().getStatusMessage() << \
" " << conn.getRequest().getRequestTarget() << RESET << std::endl;
else
std::cout << RED << conn.getRequest().getMethod() << " " << conn.getResponse().getStatusCode() << " " << \
conn.getResponse().getStatusMessage() << \
" " << conn.getRequest().getRequestTarget() << RESET << std::endl;
isLastSend = true;
}

Expand Down

0 comments on commit e9ad2b5

Please sign in to comment.