HTTP: send http status accepted where appropriate

This better reflects the request handling, since the headers are sent
before the request is fully processed. This status code just indicates
that we successfully accepted the request but is not guaranteed that all
the subsequent actions will also be successful.
This commit is contained in:
Yonas Habteab 2025-09-11 13:22:31 +02:00
parent e7c088b05b
commit e3fa5f4ae5
4 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ bool ActionsHandler::HandleRequest(
Dictionary::Ptr result = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}}; Dictionary::Ptr result = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}};
result->Freeze(); result->Freeze();
response.result(http::status::ok); response.result(http::status::accepted);
HttpUtility::SendJsonBody(response, params, result, yc); HttpUtility::SendJsonBody(response, params, result, yc);
return true; return true;

View File

@ -130,7 +130,7 @@ bool DeleteObjectHandler::HandleRequest(
Dictionary::Ptr result = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}}; Dictionary::Ptr result = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}};
result->Freeze(); result->Freeze();
response.result(http::status::ok); response.result(http::status::accepted);
HttpUtility::SendJsonBody(response, params, result, yc); HttpUtility::SendJsonBody(response, params, result, yc);
return true; return true;

View File

@ -178,7 +178,7 @@ bool ModifyObjectHandler::HandleRequest(
Dictionary::Ptr result = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}}; Dictionary::Ptr result = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}};
result->Freeze(); result->Freeze();
response.result(http::status::ok); response.result(http::status::accepted);
HttpUtility::SendJsonBody(response, params, result, yc); HttpUtility::SendJsonBody(response, params, result, yc);
return true; return true;

View File

@ -321,7 +321,7 @@ bool ObjectQueryHandler::HandleRequest(
Dictionary::Ptr results = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}}; Dictionary::Ptr results = new Dictionary{{"results", new ValueGenerator{objs, generatorFunc}}};
results->Freeze(); results->Freeze();
response.result(http::status::ok); response.result(http::status::accepted);
HttpUtility::SendJsonBody(response, params, results, yc); HttpUtility::SendJsonBody(response, params, results, yc);
return true; return true;