Changeset 434 for binary-improvements2/WebServer/src/WebAPI/APIs/Command.cs
- Timestamp:
- May 17, 2023, 11:05:59 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/WebServer/src/WebAPI/APIs/Command.cs
r426 r434 91 91 92 92 protected override void HandleRestPost (RequestContext _context, IDictionary<string, object> _jsonInput, byte[] _jsonInputData) { 93 if (! TryGetJsonField (_jsonInput, "command", out string commandString)) {94 SendE rrorResult(_context, HttpStatusCode.BadRequest, _jsonInputData, "NO_COMMAND");93 if (!JsonCommons.TryGetJsonField (_jsonInput, "command", out string commandString)) { 94 SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "NO_COMMAND"); 95 95 return; 96 96 } … … 98 98 WebCommandResult.ResultType responseType = WebCommandResult.ResultType.Full; 99 99 100 if ( TryGetJsonField (_jsonInput, "format", out string formatString)) {100 if (JsonCommons.TryGetJsonField (_jsonInput, "format", out string formatString)) { 101 101 if (formatString.EqualsCaseInsensitive ("raw")) { 102 102 responseType = WebCommandResult.ResultType.Raw; … … 115 115 116 116 if (command == null) { 117 SendE rrorResult(_context, HttpStatusCode.NotFound, _jsonInputData, "UNKNOWN_COMMAND");117 SendEmptyResponse (_context, HttpStatusCode.NotFound, _jsonInputData, "UNKNOWN_COMMAND"); 118 118 return; 119 119 } … … 122 122 123 123 if (_context.PermissionLevel > commandPermissionLevel) { 124 SendE rrorResult(_context, HttpStatusCode.Forbidden, _jsonInputData, "NO_PERMISSION");124 SendEmptyResponse (_context, HttpStatusCode.Forbidden, _jsonInputData, "NO_PERMISSION"); 125 125 return; 126 126 }
Note:
See TracChangeset
for help on using the changeset viewer.