From 60e42c2e07281bbc6690ffcfa53f5372405a25bf Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:09:55 +0530 Subject: [PATCH 1/2] Add boundary to multipart header --- src/Appwrite/Utopia/Response.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index a71e9a1e8d..8143c7b153 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -726,6 +726,7 @@ class Response extends SwooleResponse } $this + ->setContentType($multipart->exportHeader()) ->send($multipart->exportBody()); } From 59aa5fb7ce07d20eccb71b9f8fed8d086bbefba7 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:23:07 +0530 Subject: [PATCH 2/2] Add test for boundary --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index aedcdada21..aface6e822 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -1491,6 +1491,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(201, $execution['headers']['status-code']); $this->assertStringContainsString('multipart/form-data', $execution['headers']['content-type']); + $contentType = explode(';', $execution['headers']['content-type']); + $this->assertStringContainsString('boundary=----', $contentType[1]); $bytes = unpack('C*byte', $execution['body']['responseBody']); $this->assertCount(3, $bytes); $this->assertEquals(0, $bytes['byte1']);