mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
Fix the input argument parsing for sysadm-server.
This commit is contained in:
@@ -38,6 +38,7 @@ public:
|
||||
HTTPVERSION = CurHttpVersion; //default value
|
||||
if(message.isEmpty()){ return; }
|
||||
//Pull out any REST headers
|
||||
Body = message;
|
||||
if(!message.startsWith("{")){
|
||||
Header = message.section("\n{",0,0).split("\n");
|
||||
}
|
||||
@@ -56,7 +57,7 @@ public:
|
||||
//Valid JSON found
|
||||
if(doc.object().contains("namespace") ){ namesp = doc.object().value("namespace").toString(); }
|
||||
if(doc.object().contains("name") ){ name = doc.object().value("name").toString(); }
|
||||
if(doc.object().contains("id") ){ namesp = doc.object().value("id").toString(); }
|
||||
if(doc.object().contains("id") ){ id = doc.object().value("id").toString(); }
|
||||
if(doc.object().contains("args") ){ args = doc.object().value("args"); }
|
||||
else{
|
||||
//no args structure - treat the entire body as the arguments struct
|
||||
|
||||
@@ -75,6 +75,11 @@ void WebSocket::EvaluateREST(QString msg){
|
||||
qDebug() << " VERB:" << IN.VERB << "URI:" << IN.URI;
|
||||
qDebug() << " HEADERS:" << IN.Header;
|
||||
qDebug() << " BODY:" << IN.Body;
|
||||
qDebug() << "JSON Values:";
|
||||
qDebug() << " - Name:" << IN.name;
|
||||
qDebug() << " - Namespace:" << IN.namesp;
|
||||
qDebug() << " - ID:" << IN.id;
|
||||
qDebug() << " - Has Args:" << IN.args.isNull();
|
||||
}
|
||||
//Now check for the REST-specific verbs/actions
|
||||
if(IN.VERB == "OPTIONS" || IN.VERB == "HEAD"){
|
||||
|
||||
Reference in New Issue
Block a user