From c08a45812719c49e7f884fb9f0d9fc23d5de9b8e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 5 Jan 2016 14:46:00 -0500 Subject: [PATCH] Quick fix for the unauthorized return value for bad requests. --- src/server/RestStructs.h | 3 ++- src/server/WebSocket.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/RestStructs.h b/src/server/RestStructs.h index f0a84f2..81359e7 100644 --- a/src/server/RestStructs.h +++ b/src/server/RestStructs.h @@ -28,7 +28,7 @@ public: //REST Variables QString VERB, URI, HTTPVERSION; //JSON input variables - QString name, namesp, id; + QString name, namesp, id, auth; QJsonValue args; //Raw Text QStringList Header; //REST Headers @@ -48,6 +48,7 @@ public: URI = line.section(" ",1,1); HTTPVERSION = line.section(" ",2,2); Body = message.remove(Header.join("\n")+"\n"); //chop the headers off the front + //if(Header.filter( } //Now Parse out the Body into the JSON fields and/or arguments structure Body = Body.simplified(); //remove any extra whitespace on the beginning/end diff --git a/src/server/WebSocket.cpp b/src/server/WebSocket.cpp index bf7b00a..51c5805 100644 --- a/src/server/WebSocket.cpp +++ b/src/server/WebSocket.cpp @@ -205,7 +205,7 @@ void WebSocket::EvaluateRequest(const RestInputStruct &REQ){ out.out_args = outargs; }else{ //Error in inputs - assemble the return error message - out.CODE = RestOutputStruct::BADREQUEST; + out.CODE = RestOutputStruct::UNAUTHORIZED; } //If this is a REST input - go ahead and format the output header if(out.CODE == RestOutputStruct::OK){