some debug
This commit is contained in:
parent
2e01fe8d67
commit
19d786631a
3 changed files with 14 additions and 10 deletions
|
@ -26,8 +26,8 @@ constexpr std::array<std::string_view, static_cast<uint8_t>(Response::Status::__
|
|||
};
|
||||
|
||||
constexpr std::array<std::string_view, static_cast<uint8_t>(Response::ContentType::__size)> contentTypes = {
|
||||
"Content-type: text/plain",
|
||||
"Content-type: application/json"
|
||||
"Content-Type: text/plain",
|
||||
"Content-Type: application/json"
|
||||
};
|
||||
|
||||
Response::Response(Request& request):
|
||||
|
@ -50,13 +50,13 @@ void Response::send() const {
|
|||
// request.getErrorStream();
|
||||
OStream out = request.getOutputStream();
|
||||
|
||||
out << statuses[static_cast<uint8_t>(status)];
|
||||
out << statuses[static_cast<uint8_t>(status)] << "\r\n";
|
||||
if (!body.empty())
|
||||
out << '\n'
|
||||
<< contentTypes[static_cast<uint8_t>(type)]
|
||||
<< '\n'
|
||||
<< '\n'
|
||||
out << contentTypes[static_cast<uint8_t>(type)] << "\r\n"
|
||||
<< "\r\n"
|
||||
<< body;
|
||||
else
|
||||
out << "\r\n";
|
||||
|
||||
request.responseIsComplete();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue