changed: if there is no body we do not parse application/json to space

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1183 e52654a7-88a9-db11-a3e9-0013d4bc506e
pull/3/head
Tomasz Sowa 4 years ago
parent 4c2efc08fd
commit 177e58da4e

@ -1095,14 +1095,21 @@ void App::ReadPostJson()
}
while( read_len == buffer_len );
PT::JSONToSpaceParser::Status status = post_json_parser.ParseString(post_buffer.c_str());
post_buffer.clear();
if( !post_buffer.empty() )
{
PT::JSONToSpaceParser::Status status = post_json_parser.ParseString(post_buffer.c_str());
post_buffer.clear();
if( status != PT::JSONToSpaceParser::ok )
if( status != PT::JSONToSpaceParser::ok )
{
log << log1 << "App: cannot parse the input stream as a JSON object, status: " << (int)status << logend;
cur.request->post_in.Clear();
// return an error (http error of some kind?)
}
}
else
{
log << log1 << "App: cannot parse the input stream as a JSON object, status: " << (int)status << logend;
cur.request->post_in.Clear();
// return an error (http error of some kind?)
log << log3 << "App: input body empty (skipping parsing)" << logend;
}
}

Loading…
Cancel
Save