Skip to content

Commit

Permalink
Add ServerWebService::send500
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Dec 24, 2024
1 parent dda504b commit 77c4eeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions soup/ServerWebService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ NAMESPACE_SOUP
sendResponse(s, "404", "Content-Length: 0\r\n\r\n");
}

void ServerWebService::send500(Socket& s)
{
sendResponse(s, "500", "Content-Length: 0\r\n\r\n");
}

void ServerWebService::sendResponse(Socket& s, const char* status, const std::string& headers_and_body)
{
std::string cont = "HTTP/1.0 ";
Expand Down
1 change: 1 addition & 0 deletions soup/ServerWebService.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ NAMESPACE_SOUP
static void send204(Socket& s);
static void send400(Socket& s);
static void send404(Socket& s);
static void send500(Socket& s);
static void sendResponse(Socket& s, const char* status, const std::string& headers_and_body);

// WebSocket
Expand Down

0 comments on commit 77c4eeb

Please sign in to comment.