Skip to content

Commit 90f8e7d

Browse files
committed
Fix #135 Invalid HTTP request headers in non-cURL
Thanks to @Fearitude for spotting this bug.
1 parent ba5013f commit 90f8e7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/codebird.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,9 @@ protected function getNoCurlInitialization($url, $contextOptions, $hostname = ''
744744
array('http' => $httpOptions)
745745
);
746746

747+
// concatenate $options['http']['header']
748+
$options['http']['header'] = implode("\r\n", $options['http']['header']);
749+
747750
// silent the file_get_contents function
748751
$content = @file_get_contents($url, false, stream_context_create($options));
749752

0 commit comments

Comments
 (0)