forked from cat/WebBase
Tiding up
This commit is contained in:
@@ -31,7 +31,7 @@ void HTTPrequest::sendResponse(std::string status, std::string mime,
|
||||
asio::async_write(
|
||||
sock, asio::buffer(responseText),
|
||||
[this, self = shared_from_this()](std::error_code, std::size_t) {
|
||||
sock.shutdown(asio::ip::tcp::socket::shutdown_send);
|
||||
sock.shutdown(asio::ip::tcp::socket::shutdown_both);
|
||||
waitForClientClose();
|
||||
});
|
||||
}
|
||||
|
@@ -5,9 +5,6 @@
|
||||
#include <istream>
|
||||
#include <string>
|
||||
|
||||
// TODO: Remove boundary from the body. Do keep other stuff like
|
||||
// file type and name
|
||||
|
||||
void HTTPrequest::processHTTPHeader() {
|
||||
std::shared_ptr<HTTPrequest> self(shared_from_this());
|
||||
|
||||
|
@@ -22,13 +22,7 @@ void Webserver::initResponses() {
|
||||
auto result = Helpers::processFormData(self->bodyContent,
|
||||
self->headers["Content-Type"]);
|
||||
std::stringstream resp;
|
||||
resp << "You have sent\n"
|
||||
<< "filePassword = " << result["filePassword"].data << "\n"
|
||||
<< "name = " << result["name"].data << "\n"
|
||||
<< "numb = " << result["numb"].data << "\n"
|
||||
<< "time = " << result["time"].data << "\n"
|
||||
<< "uploadedFile = " << result["uploadedFile"].data << " as filetype "
|
||||
<< result["uploadedFile"].headers["Content-Type"] << "\n";
|
||||
resp << self->bodyContent;
|
||||
self->sendResponse("200 OK", "text/text", resp.str());
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user