Commit a24acf40 authored by jan.koester's avatar jan.koester
Browse files

test

parent d53beca9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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.";
@@ -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