Skip to content

Commit

Permalink
fixed header support in client
Browse files Browse the repository at this point in the history
  • Loading branch information
poef committed May 30, 2022
1 parent f3d7520 commit 565cffe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http/ClientStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function request( $type, $url, $request = null, $options = [] )
'content' => $request
] + (array) $options;

$options['headers'] = $this->mergeHeaders(
$options['header'] = $this->mergeHeaders(
\arc\hash::get('header', $this->options),
\arc\hash::get('headers', $this->options),
\arc\hash::get('header', $options),
Expand All @@ -96,7 +96,7 @@ public function request( $type, $url, $request = null, $options = [] )
$context = stream_context_create( [ 'http' => $options ] );
$result = @file_get_contents( (string) $url, false, $context );
$this->responseHeaders = isset($http_response_header) ? $http_response_header : null; //magic php variable set by file_get_contents.
$this->requestHeaders = isset($options['headers']) ? explode("\r\n",$options['headers']) : [];
$this->requestHeaders = isset($options['header']) ? explode("\r\n",$options['header']) : [];

return $result;
}
Expand Down

0 comments on commit 565cffe

Please sign in to comment.