From aa5f9efed6503a7f2aafe16966b4ff2ce30f12dc Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 17 Jun 2026 08:33:24 +0530 Subject: [PATCH] fix(php): send accept header on chunked upload requests The chunked-upload path rebuilt $apiHeaders with only content-type and the security headers, dropping the accept header that the standard request path and single-shot file uploads now set. Large uploads (Storage files, Function/Site deployments above CHUNK_SIZE) therefore sent their first and parallel chunk requests without Accept, making content negotiation and response parsing differ by upload size. Build the rebuilt header array from the same securityHeaders, header params, and method.headers loops used elsewhere so accept (and any other method headers) are included for every chunk. --- templates/php/base/requests/file.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/php/base/requests/file.twig b/templates/php/base/requests/file.twig index c75bc55875..5463de52a2 100644 --- a/templates/php/base/requests/file.twig +++ b/templates/php/base/requests/file.twig @@ -95,10 +95,15 @@ {% endfor %} $apiHeaders = [ - 'content-type' => 'multipart/form-data', {%~ for key, security in method.securityHeaders %} '{{ security.name }}' => $this->client->getConfig('{{ key | caseLower }}'), {%~ endfor %} + {%~ for parameter in method.parameters.header %} + '{{ parameter.name }}' => ${{ parameter.name | caseCamel }}, + {%~ endfor %} + {%~ for key, header in method.headers %} + '{{ key }}' => '{{ header }}', + {%~ endfor %} ]; $handle = null;