".tgz" files somtimes decompressed in error.

オープン
#437 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

@jerrm がすでに取り組んでいます。

2020年11月22日 から。

  • #438 @jerrm による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php
領域
networking

調査の方向性

レスポンスの content-encoding ヘッダーによってガードされている解凍分岐を、Requests.php から確認します。リンクされている Bitbucket の .tgz サンプルで問題を再現し、値 "none" の処理を調べます。content-encoding が "none" のファイルが解凍されず、ダウンロードしたアーカイブがチェックサム検証に引き続き適した状態であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Requests.php will mistakenly decompress a .tgz file (or other gzipped files) downloaded from sites that pass a "content-encoding: none" header.

In the case of .tgz files, you end up with a misnamed, uncompressed tar file. Often manageable, but not if there needs to be an md5/sha1/etc checksum confirmation.

The decompress code is wrapped by if (isset($return->headers['content-encoding'])), so the decompress code fires even though the encoding is "none". Should there be a check for a proper encoding type, or at minimum, check for "none" before decompressing?

Ran into this with bitbucket. A sample file to demonstrate the issue: https://bitbucket.org/jerrm-bb/testdownload/downloads/outcnam-test.tgz

主要言語
PHP
スター
3.6k
フォーク
503
平均マージ
5日 10時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WordPress/Requests のほかの issue

WordPress/Requests の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。