Does WordPress only support HTTP 1.1?

I’m not sure if this is a bug or if I’m missing anything. But according to the documentation for WP_Http::request(), you should be able to set the HTTP protocol version with the httpversion option.

Indeed it seems to default to 1.0 according to line 181 of class-http.php:

            'httpversion'         => apply_filters( 'http_request_version', '1.0', $url ),

But that value isn’t actually passed down to Requests::request(). That method gets its default options from Requests::get_default_options(), which has an option, protocol_version, which defaults to 1.1.

It never actually reads httpversion, nor is httpversion even passed in the options.

All the transports then seem to read the protocol_version option, which is never configurable as far as I can tell.

So my question is, is this a bug or am I just missing something? Setting httpversion doesn’t actually seem to accomplish anything, and you can’t actually set protocol_version.

0

Leave a Comment