mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Support array headers for set-cookie
This commit is contained in:
@@ -9,6 +9,12 @@ use Utopia\System\System;
|
||||
|
||||
class Executor
|
||||
{
|
||||
// 0.8.6 is last version with object-based headers
|
||||
public const RESPONSE_FORMAT_OBJECT_HEADERS = '0.10.0';
|
||||
|
||||
// 0.9.0 is first version with array-based headers
|
||||
public const RESPONSE_FORMAT_ARRAY_HEADERS = '0.11.0';
|
||||
|
||||
public const METHOD_GET = 'GET';
|
||||
public const METHOD_POST = 'POST';
|
||||
public const METHOD_PUT = 'PUT';
|
||||
@@ -170,6 +176,7 @@ class Executor
|
||||
* @param string $entrypoint
|
||||
* @param string $runtimeEntrypoint
|
||||
* @param bool $logging
|
||||
* @param string $responseFormat
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -190,7 +197,8 @@ class Executor
|
||||
int $memory,
|
||||
bool $logging,
|
||||
string $runtimeEntrypoint = '',
|
||||
?int $requestTimeout = null
|
||||
?int $requestTimeout = null,
|
||||
string $responseFormat = self::RESPONSE_FORMAT_OBJECT_HEADERS
|
||||
) {
|
||||
if (empty($headers['host'])) {
|
||||
$headers['host'] = System::getEnv('_APP_DOMAIN', '');
|
||||
@@ -232,7 +240,7 @@ class Executor
|
||||
$requestTimeout = $timeout + 15;
|
||||
}
|
||||
|
||||
$response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data' ], $params, true, $requestTimeout);
|
||||
$response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data', 'x-executor-response-format' => $responseFormat ], $params, true, $requestTimeout);
|
||||
|
||||
$status = $response['headers']['status-code'];
|
||||
if ($status >= 400) {
|
||||
|
||||
Reference in New Issue
Block a user