Skip to content

Commit

Permalink
Merge pull request #3080 from catchpoint/blacklist_agent_version
Browse files Browse the repository at this point in the history
Blacklist agent version
  • Loading branch information
claud-io authored Jun 18, 2024
2 parents cd8e049 + 8876736 commit 16b7735
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions www/work/getwork.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
$tester = trim($_SERVER['REMOTE_ADDR']);
}

$allowed_versions = GetSetting('allowed_versions');
if ($allowed_versions) {
$allowed_versions = explode(',', $allowed_versions);
$version = array_key_exists('version', $_GET) ? $_GET['version'] : '';
if (!in_array($version, $allowed_versions)) {
header("HTTP/1.1 403 Unauthorized");
exit();
}
}

$block_list = GetSetting('block_pc');
if ($block_list && strlen($block_list) && strlen($pc)) {
$block = explode(',', $block_list);
Expand Down

0 comments on commit 16b7735

Please sign in to comment.