Make WordPress Core

Opened 2 years ago

Last modified 8 months ago

#53513 assigned defect (bug)

WP_Http ignores httpversion option

Reported by: cocreation's profile cocreation Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.6
Component: HTTP API Keywords: has-patch has-unit-tests
Focuses: Cc:


WP_Http::request() uses the httpversion argument, which the documentation says will set the HTTP protocol version of the request.

However when it calls Requests::request(), the httpversion option is never passed. Instead, it uses protocol_version, as seen in Requests::get_default_options().

Yet there is no way to set protocol_version, and it always defaults to 1.1.

It seems that httpversion is not actually used anywhere, and should be updated to protocol_version.

Change History (4)

#1 @ocean90
23 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 5.7.2 to 4.6

This ticket was mentioned in PR #2145 on WordPress/wordpress-develop by chesio.

23 months ago

  • Keywords has-patch has-unit-tests added; needs-patch removed

Use proper option name when setting HTTP protocol version for external request made by Requests library. Include unit tests that fail on current trunk and pass when this PR is applied.

Trac ticket:

#3 @chesio
15 months ago

Hi @ocean90, is there anything else I can do in order to get the PR merged? It's a simple fix and unit tests are included...

#4 @jonte98
8 months ago

It would be so great if HTTP 2.0 and 3.0 was added.

Or if the bug was addressed.

I mean, it's better performance and security in HTTP/2 and HTTP/3.

Most malicious traffic operate on 1.0 and 1.1...

Note: See TracTickets for help on using tickets.