Skip to content

Commit e2de994

Browse files
authored
Merge pull request #234 from open-runtimes/chore/bump-utopia-http-2.0-rc5
Chore: bump utopia-php/http to 2.0.0-rc5
2 parents 8c9c5ef + 3f8db65 commit e2de994

3 files changed

Lines changed: 67 additions & 65 deletions

File tree

app/controllers.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
->action(function (string $runtimeId, string $timeoutStr, Response $response, Runner $runner): void {
2929
$timeout = \intval($timeoutStr);
3030

31-
$response->sendHeader('Content-Type', 'text/event-stream');
32-
$response->sendHeader('Cache-Control', 'no-cache');
31+
$response->sendHeader('Content-Type', ['text/event-stream']);
32+
$response->sendHeader('Cache-Control', ['no-cache']);
3333

3434
$runner->getLogs($runtimeId, $timeout, $response);
3535

@@ -234,7 +234,7 @@ function (
234234
);
235235

236236
// Backwards compatibility for headers
237-
$responseFormat = $request->getHeader('x-executor-response-format', '0.10.0'); // Last version without support for array value for headers
237+
$responseFormat = $request->getHeaderLine('x-executor-response-format', '0.10.0'); // Last version without support for array value for headers
238238
if (version_compare($responseFormat, '0.11.0', '<')) {
239239
foreach ($execution['headers'] as $key => $value) {
240240
if (\is_array($value)) {
@@ -244,7 +244,7 @@ function (
244244
}
245245
}
246246

247-
$acceptTypes = \explode(', ', $request->getHeader('accept', 'multipart/form-data'));
247+
$acceptTypes = \explode(', ', $request->getHeaderLine('accept', 'multipart/form-data'));
248248
$isJson = array_any($acceptTypes, fn ($acceptType): bool => \str_starts_with((string) $acceptType, 'application/json') || \str_starts_with((string) $acceptType, 'application/*'));
249249

250250
if ($isJson) {
@@ -284,7 +284,7 @@ function (
284284
->groups(['api'])
285285
->inject('request')
286286
->action(function (Request $request): void {
287-
$secretKey = \explode(' ', $request->getHeader('authorization', ''))[1] ?? '';
287+
$secretKey = \explode(' ', $request->getHeaderLine('authorization', ''))[1] ?? '';
288288
if ($secretKey === '' || $secretKey === '0' || $secretKey !== System::getEnv('OPR_EXECUTOR_SECRET', '')) {
289289
throw new Exception(Exception::GENERAL_UNAUTHORIZED, 'Missing executor key');
290290
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"utopia-php/console": "^0.1.1",
2929
"utopia-php/di": "0.3.*",
3030
"utopia-php/dsn": "0.2.*",
31-
"utopia-php/http": "0.34.*",
31+
"utopia-php/http": "2.0.0-rc5@RC",
3232
"utopia-php/orchestration": "^0.19.2",
3333
"utopia-php/storage": "^2.0",
3434
"utopia-php/system": "0.10.*"

composer.lock

Lines changed: 61 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)