mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5044 from Icinga/fix/api-post-error-5043
API: Fix error code for invalid 'attrs' type for POST requests fixes #5043
This commit is contained in:
commit
bb2ee7f495
|
@ -68,7 +68,15 @@ bool ModifyObjectHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& r
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary::Ptr attrs = params->Get("attrs");
|
Value attrsVal = params->Get("attrs");
|
||||||
|
|
||||||
|
if (attrsVal.GetReflectionType() != Dictionary::TypeInstance) {
|
||||||
|
HttpUtility::SendJsonError(response, 400,
|
||||||
|
"Invalid type for 'attrs' attribute specified. Dictionary type is required.", Empty);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary::Ptr attrs = attrsVal;
|
||||||
|
|
||||||
Array::Ptr results = new Array();
|
Array::Ptr results = new Array();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue