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
This commit is contained in:
parent
4c2efc08fd
commit
177e58da4e
|
@ -1095,14 +1095,21 @@ void App::ReadPostJson()
|
||||||
}
|
}
|
||||||
while( read_len == buffer_len );
|
while( read_len == buffer_len );
|
||||||
|
|
||||||
PT::JSONToSpaceParser::Status status = post_json_parser.ParseString(post_buffer.c_str());
|
if( !post_buffer.empty() )
|
||||||
post_buffer.clear();
|
|
||||||
|
|
||||||
if( status != PT::JSONToSpaceParser::ok )
|
|
||||||
{
|
{
|
||||||
log << log1 << "App: cannot parse the input stream as a JSON object, status: " << (int)status << logend;
|
PT::JSONToSpaceParser::Status status = post_json_parser.ParseString(post_buffer.c_str());
|
||||||
cur.request->post_in.Clear();
|
post_buffer.clear();
|
||||||
// return an error (http error of some kind?)
|
|
||||||
|
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 << log3 << "App: input body empty (skipping parsing)" << logend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue