Loading src/blogi.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ void blogi::Blogi::api(libhttppp::HttpRequest& curreq, const int tid){ libhttppp::HttpResponse resp; // 1. Basic Content Length Check if(clen > curreq.RecvData.size() || clen == 0){ if(clen == 0){ resp.setState(HTTP400); // Bad Request resp.setContentType("text/plain"); const char* err = "Api: Incomplete or empty request."; Loading @@ -214,6 +214,12 @@ void blogi::Blogi::api(libhttppp::HttpRequest& curreq, const int tid){ return; } if(clen > curreq.RecvData.size()){ libhttppp::HTTPException err; err[libhttppp::HTTPException::Note] << "api req wait for more data."; throw err; } bool asuccess = false; std::vector<char> content; // Copy only the content length number of bytes Loading Loading
src/blogi.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ void blogi::Blogi::api(libhttppp::HttpRequest& curreq, const int tid){ libhttppp::HttpResponse resp; // 1. Basic Content Length Check if(clen > curreq.RecvData.size() || clen == 0){ if(clen == 0){ resp.setState(HTTP400); // Bad Request resp.setContentType("text/plain"); const char* err = "Api: Incomplete or empty request."; Loading @@ -214,6 +214,12 @@ void blogi::Blogi::api(libhttppp::HttpRequest& curreq, const int tid){ return; } if(clen > curreq.RecvData.size()){ libhttppp::HTTPException err; err[libhttppp::HTTPException::Note] << "api req wait for more data."; throw err; } bool asuccess = false; std::vector<char> content; // Copy only the content length number of bytes Loading