1
0
Fork 0
mirror of synced 2024-07-04 14:10:33 +12:00

Remove response body & headers

This commit is contained in:
Matej Bačo 2023-02-27 11:20:37 +01:00
parent 18021b6fbd
commit d7c5d8bb46
3 changed files with 2 additions and 31 deletions

View file

@ -2931,17 +2931,6 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('body'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 1000000,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('errors'),
'type' => Database::VAR_STRING,
@ -2975,17 +2964,6 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('headers'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 16384,
'signed' => true,
'required' => false,
'default' => [],
'array' => false,
'filters' => ['json'],
],
[
'$id' => ID::custom('duration'),
'type' => Database::VAR_FLOAT,

View file

@ -1180,8 +1180,6 @@ App::post('/v1/functions/:functionId/executions')
'trigger' => 'http', // http / schedule / event
'status' => $async ? 'waiting' : 'processing', // waiting / processing / completed / failed
'statusCode' => 0,
'body' => '',
'headers' => [],
'errors' => '',
'logs' => '',
'duration' => 0.0,
@ -1279,8 +1277,6 @@ App::post('/v1/functions/:functionId/executions')
$status = $executionResponse['statusCode'] >= 500 ? 'failed' : 'completed';
$execution->setAttribute('status', $status);
$execution->setAttribute('statusCode', $executionResponse['statusCode']);
$execution->setAttribute('headers', $executionResponse['headers']);
$execution->setAttribute('body', $executionResponse['body']);
$execution->setAttribute('logs', $executionResponse['logs']);
$execution->setAttribute('errors', $executionResponse['errors']);
$execution->setAttribute('duration', $executionResponse['duration']);
@ -1295,7 +1291,6 @@ App::post('/v1/functions/:functionId/executions')
}
if($function->getAttribute('logging')) {
$execution->setAttribute('body', \mb_strcut($execution->getAttribute('body') , 0, 1000000)); // Limit to 1MB
Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution));
}
@ -1315,6 +1310,8 @@ App::post('/v1/functions/:functionId/executions')
$execution->setAttribute('errors', '');
}
$execution->setAttribute('body', $executionResponse['body']);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
->dynamic($execution, Response::MODEL_EXECUTION);

View file

@ -89,8 +89,6 @@ Server::setResource('execute', function () {
'trigger' => $trigger,
'status' => 'processing',
'statusCode' => 0,
'body' => '',
'headers' => [],
'errors' => '',
'logs' => '',
'duration' => 0.0,
@ -161,8 +159,6 @@ Server::setResource('execute', function () {
$execution
->setAttribute('status', $status)
->setAttribute('statusCode', $executionResponse['statusCode'])
->setAttribute('headers', $executionResponse['headers'])
->setAttribute('body', $executionResponse['body'])
->setAttribute('logs', $executionResponse['logs'])
->setAttribute('errors', $executionResponse['errors'])
->setAttribute('duration', $executionResponse['duration']);