From da108071d5fb8098d567616db234caacf55a7b51 Mon Sep 17 00:00:00 2001 From: Yury German Date: Tue, 26 Apr 2016 00:51:29 -0400 Subject: Adding jetpack-4.0.2 --- plugins/jetpack/class.jetpack-client.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/jetpack/class.jetpack-client.php') diff --git a/plugins/jetpack/class.jetpack-client.php b/plugins/jetpack/class.jetpack-client.php index 33dce110..8eafd6cf 100644 --- a/plugins/jetpack/class.jetpack-client.php +++ b/plugins/jetpack/class.jetpack-client.php @@ -17,6 +17,7 @@ class Jetpack_Client { 'method' => 'POST', 'timeout' => 10, 'redirection' => 0, + 'headers' => array(), ); $args = wp_parse_args( $args, $defaults ); @@ -106,9 +107,9 @@ class Jetpack_Client { foreach ( $auth as $key => $value ) { $header_pieces[] = sprintf( '%s="%s"', $key, $value ); } - $request['headers'] = array( + $request['headers'] = array_merge( $args['headers'], array( 'Authorization' => "X_JETPACK " . join( ' ', $header_pieces ), - ); + ) ); // Make sure we keep the host when we do JETPACK__WPCOM_JSON_API_HOST requests. $host = parse_url( $url, PHP_URL_HOST ); -- cgit v1.2.3-65-gdbad