Force user to set a secret/auth token for webhooks

This change ends execution if the default auth token/secret has not been changed.
This commit is contained in:
2015-08-03 13:12:59 +02:00
parent 6516026e6a
commit fed7b6988d
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -61,6 +61,12 @@ define('TOOLKIT_PATH', '/home/<user>/bin');
// We are always returning plain text
header('Content-Type: text/plain');
// Check if a secret has been set
if(SECRET == '<long token>') {
http_response_code(400);
die('No secret has been set in ' . basename(__FILE__) . '. This script won\'t work without one.');
}
// Check which event this is
if(!isset($_SERVER['HTTP_X_GITHUB_EVENT'])) {
http_response_code(400);