diff --git a/src/WordPress/AsyncHttp/Client.php b/src/WordPress/AsyncHttp/Client.php index dd3dec0c..8763c835 100644 --- a/src/WordPress/AsyncHttp/Client.php +++ b/src/WordPress/AsyncHttp/Client.php @@ -192,7 +192,7 @@ public function process_queue() { foreach ( $streams as $k => $stream ) { $request = $enqueued[ $k ]; - $total = $response_headers[ $k ]['headers']['content-length']; + $total = $response_headers[ $k ]['headers']['content-length'] ?? null; $this->requests[ $request ]->state = RequestInfo::STATE_STREAMING; $this->requests[ $request ]->stream = stream_monitor_progress( $stream, diff --git a/src/WordPress/AsyncHttp/async_http_streams.php b/src/WordPress/AsyncHttp/async_http_streams.php index 71d4581b..24a63839 100644 --- a/src/WordPress/AsyncHttp/async_http_streams.php +++ b/src/WordPress/AsyncHttp/async_http_streams.php @@ -219,18 +219,17 @@ function stream_http_prepare_request_bytes( $url ) { $parts = parse_url( $url ); $host = $parts['host']; $path = $parts['path'] . ( isset( $parts['query'] ) ? '?' . $parts['query'] : '' ); - $request = <<