com web/qa: GitHub requires a user agent nowadays: pulls/api.php
| From: | Johannes Schlüter | Date: | Wed, 08 May 2013 10:08:52 +0000 |
| Subject: | com web/qa: GitHub requires a user agent nowadays: pulls/api.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66865@lists.php.net to get a copy of this message | ||
Commit: 2f0f19f2fb9fc04c8e3d1561fb84e3738420ccae
Author: Johannes Schlüter <johannes@schlueters.de> Wed, 8 May 2013 12:08:52 +0200
Parents: bfc6f84bc6efbf1e44f47879bffe6f19472ddb87
Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=2f0f19f2fb9fc04c8e3d1561fb84e3738420ccae
Log:
GitHub requires a user agent nowadays
Changed paths:
M pulls/api.php
Diff:
diff --git a/pulls/api.php b/pulls/api.php
index c7e0a67..148a6df 100644
--- a/pulls/api.php
+++ b/pulls/api.php
@@ -1,6 +1,7 @@
<?php
$errors = array();
require('./config.php');
+define('USER_AGENT', 'PHP Pull Request Admin (http://qa.php.net/pulls
php-qa@lists.php.net)');
if ($_SERVER['SERVER_NAME'] === 'schlueters.de') {
define('DEV', true);
@@ -178,7 +179,8 @@ function ghupdate()
$url =
GITHUB_BASEURL.'repos/'.GITHUB_ORG.'/'.urlencode($_POST['repo']).'/pulls/'.$_POST['id'];
$ctxt = stream_context_create(array(
'http' => array(
- 'ignore_errors' => '1'
+ 'ignore_errors' => '1',
+ 'user_agent' => USER_AGENT,
)
));
$pull_raw = @file_get_contents($url, false, $ctxt);