From 4ce004ee06fc97c511e8f3b36ef98ff80e53c0a6 Mon Sep 17 00:00:00 2001 From: y-syo Date: Tue, 8 Apr 2025 01:13:02 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=93=9D=E3=80=8D=20doc(http):=20r?= =?UTF-8?q?emoved=20debug=20logs=20for=20readable=20stdout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/requests_handling/HttpRequests.cpp | 12 ++++++------ src/requests_handling/HttpResponse.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/requests_handling/HttpRequests.cpp b/src/requests_handling/HttpRequests.cpp index 0e37862..1a1e7dd 100644 --- a/src/requests_handling/HttpRequests.cpp +++ b/src/requests_handling/HttpRequests.cpp @@ -6,7 +6,7 @@ /* By: mmoussou _target.c_str())) throw std::runtime_error("can't remove file, FF"); response.setProtocol(this->_protocol); - response.setStatusCode(204); // this cool dude on the internet said i should not do that so i'll change it https://blog.ploeh.dk/2013/04/30/rest-lesson-learned-avoid-204-responses/ + response.setStatusCode(204); time_t now = std::time(NULL); response.addHeader("Date", std::string(std::ctime(&now))); } @@ -330,7 +330,7 @@ void http::Post::parse(std::string const &data) body_stream << line << "\n"; this->_body = body_stream.str(); - ///* + /* std::cout << "-- start-line --" << std::endl; std::cout << "method: " << this->_method << std::endl; std::cout << "target: " << this->_target << std::endl; @@ -340,8 +340,8 @@ void http::Post::parse(std::string const &data) for (std::map::const_iterator it = this->_headers.begin(); it != this->_headers.end(); ++it) std::cout << it->first << ": " << it->second << std::endl; std::cout << std::endl; - std::cout << "-- body --" << std::endl << this->_body << std::endl; - //*/ + //std::cout << "-- body --" << std::endl << this->_body << std::endl; + */ } std::string extractFilename(const std::string &header) @@ -365,7 +365,7 @@ void handleMultipartData(const std::string &body, const std::string &boundary) if (end != std::string::npos) { std::string part_header = body.substr(start, end - start); - std::cout << std::endl<< std::endl<< std::endl<< std::endl<< std::endl; + //std::cout << std::endl << std::endl << std::endl << std::endl; std::string part_content = body.substr(end + 4, body.find(delim, end) - end - 4); std::ofstream outfile(extractFilename(part_header).c_str(), std::ios::binary); diff --git a/src/requests_handling/HttpResponse.cpp b/src/requests_handling/HttpResponse.cpp index c0d91dd..9fccdb4 100644 --- a/src/requests_handling/HttpResponse.cpp +++ b/src/requests_handling/HttpResponse.cpp @@ -6,7 +6,7 @@ /* By: mmoussou _body; - std::cout << "------------ RESPONSE -------------" << std::endl << response.str(); + //std::cout << "------------ RESPONSE -------------" << std::endl << response.str(); return (response.str()); }