WordPress.org

Make WordPress Core

Changeset 37430


Ignore:
Timestamp:
05/13/2016 11:14:06 AM (4 years ago)
Author:
rmccue
Message:

HTTP API: Fix compatibility with cURL <7.22

Ensure connections are closed after usage to fix an issue with WP.com URLs used in the tests.

Resynched from GitHub at 95518ce.

See #33055.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/Requests/Transport/cURL.php

    r37428 r37430  
    309309    protected function setup_handle($url, $headers, $data, $options) {
    310310        $options['hooks']->dispatch('curl.before_request', array(&$this->handle));
     311
     312        // Force closing the connection for old versions of cURL (<7.22).
     313        if ( ! isset( $headers['Connection'] ) ) {
     314            $headers['Connection'] = 'close';
     315        }
    311316
    312317        $headers = Requests::flatten($headers);
Note: See TracChangeset for help on using the changeset viewer.