Improve error message for POST queries

If the user does a POST query but forgets to add the
'X-HTTP-Method-Override: GET' HTP header, the error message was
misleading. This changes the error message to a more detailed message
which might give the user a better understanding what the problem
could be.

Fixes #7675.
This commit is contained in:
Matthias Baur 2019-12-03 11:29:10 +01:00
parent bb08f190a1
commit 177c45d787
No known key found for this signature in database
GPG Key ID: B5FC9F20AD4618D6
1 changed files with 2 additions and 1 deletions

View File

@ -65,7 +65,8 @@ bool ModifyObjectHandler::HandleRequest(
if (attrsVal.GetReflectionType() != Dictionary::TypeInstance) { if (attrsVal.GetReflectionType() != Dictionary::TypeInstance) {
HttpUtility::SendJsonError(response, params, 400, HttpUtility::SendJsonError(response, params, 400,
"Invalid type for 'attrs' attribute specified. Dictionary type is required."); "Invalid type for 'attrs' attribute specified. Dictionary type is required."
"Or is this a POST query and you missed adding a 'X-HTTP-Method-Override: GET' header?");
return true; return true;
} }