Disable legacy HTTP image hooks by default
This commit is contained in:
+11
-1
@@ -1,6 +1,16 @@
|
||||
<?php
|
||||
namespace sammo\img_service;
|
||||
|
||||
if (php_sapi_name() !== 'cli' && !file_exists(__DIR__.'/legacy-enabled')) {
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(410);
|
||||
die(json_encode([
|
||||
'result'=>false,
|
||||
'reason'=>'legacy pull disabled',
|
||||
'version'=>null,
|
||||
]));
|
||||
}
|
||||
|
||||
include(__DIR__.'/HashKey.php');
|
||||
|
||||
function hashPassword($salt, $password)
|
||||
@@ -106,4 +116,4 @@ file_put_contents('list.json', json_encode($img_list));
|
||||
$json_response['result'] = true;
|
||||
$json_response['reason'] = 'success';
|
||||
$json_response['version'] = getVersion();
|
||||
die(json_encode($json_response));
|
||||
die(json_encode($json_response));
|
||||
|
||||
Reference in New Issue
Block a user