Unable to send large attachment: LargeFileUploadTask and headers
まだ誰も着手していません。
評価
調査の方向性
Microsoft\Kiota\Abstractions\RequestHeaders から始めて getAll メソッドを調査し、特にヘッダー値に対する array_keys の処理を確認します。PHP 8.4 で大きな添付ファイルのアップロードパスを再現または検証し、getAll が string 型のヘッダーキーを返し、大きな添付ファイルを Guzzle request deprecation なしで送信できることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Unable to upload large attachment. In the file Microsoft\Kiota\Abstractions\RequestHeaders, the array_keys function is used, which casts a string to a number. PHP 8.4 on x64 does this.
In the getAll method, it is cast and then an error is returned: Since guzzlehttp/psr7 2.11: Passing int to GuzzleHttp\Psr7\Request::__construct() is deprecated; guzzlehttp/psr7 3.0 requires string|string[].
Instead of array_keys, you must use foreach.
A method with array_keys that casts string to int.
public function getAll(): array
{
$result = [];
foreach ($this->headers as $key => $value) {
$result[$key] = array_keys($value);
}
return $result;
}
A method with foreach that works.
public function getAll(): array
{
$result = [];
foreach ($this->headers as $key => $value) {
foreach ($value as $k => $v) {
$result[$key][] = strval($k);
}
//$result[$key] = array_keys($value);
}
return $result;
}
After this change, sending large attachments works.
- 主要言語
- PHP
- スター
- 669
- フォーク
- 150
- 平均マージ
- 15時間 21分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-php のほかの issue
-
bug: metadata type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoftgraph/msgraph-sdk-php#1739 · コメント 6 件 ·
-
status:waiting-for-triage type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
microsoftgraph/msgraph-sdk-php#1643 · コメント 8 件 · リアクション 4 件 ·
-
status:waiting-for-triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoftgraph/msgraph-sdk-php#1800 · リアクション 1 件 ·
-
Now オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
-
status:waiting-for-triage
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoftgraph/msgraph-sdk-php#1792 ·
microsoftgraph/msgraph-sdk-php の issue をすべて見る
似ている issue
-
priority: p3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextcloud/fulltextsearch#1011 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
phpstan/phpstan-doctrine#794 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Automattic/static-site-importer#1767 ·