Last active
December 16, 2015 14:59
-
-
Save clemherreman/5452898 to your computer and use it in GitHub Desktop.
request_fulluri Composer/github bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = array( | |
'http' => array( | |
'method' => 'GET', | |
'verify_peer' => false, | |
'allow_self_signed' => true, | |
'follow_location' => 1, | |
'max_redirects' => 20, | |
'proxy' => 'tcp://your.proxy.ip:yourProxyPort', | |
// Uncomment the following line to reproduce the bug | |
// 'request_fulluri' => 1, | |
'header' => array( | |
'1' => "Accept-Encoding: gzip", | |
'0' => "User-Agent: Composer/source (Windows NT; 6.1; PHP 5.3.12)", | |
), | |
), | |
); | |
$context = stream_context_create($options); | |
$url = 'https://api.github.com/repos/doctrine/collections/zipball/df2138bcb467533bfe6b3a01301d480aec008b93'; | |
$data = substr(file_get_contents($url, false, $context), 0, 1000); //Truncate to avoid polluting the shell | |
var_dump($data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment