WordPress / WordPress/Requests

Requests class: review and improve decompression methods

Open
#596 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: enhancement Type: testing/chores/QA
Dominant language
PHP
Stars
3.6k
Forks
500
Avg merge
2d 21h
Merged PRs (30d)
5

Description

As per #595:

The methods covered via the DecompressionTest test class need a lot more tests, in particular the Requests::compatible_gzinflate() method, which includes code paths currently completely untested and handling of ZIP file format, which when called from Requests::decompress() (which is the only way it is called from within the Requests library itself), can never be reached as the "magic markers" used by ZIP are not included in the Requests::$magic_compression_headers property.

A future iteration should do a more in-depth review of these two method to determine what should be handled by each method and add additional tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the DecompressionTest test class and the implementations of Requests::compatible_gzinflate() and Requests::decompress(), including Requests::$magic_compression_headers. Compare the covered and unreachable paths described in #595; done means the intended responsibilities are clarified and the relevant decompression and ZIP-handling behavior has focused test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.