Stream snapshot file listings
This commit is contained in:
+2
-1
@@ -6,6 +6,7 @@ header('Content-Type: application/json');
|
||||
$socket = '/run/urbm/urbm.sock';
|
||||
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
|
||||
$path = $_GET['path'] ?? '/v1/health';
|
||||
$isSnapshotFileRequest = preg_match('#/snapshots/[^/]+/files(?:\?|$)#', $path) === 1;
|
||||
|
||||
if (!preg_match('#^/v1/[A-Za-z0-9_./?=&%:-]*$#', $path) || str_contains($path, '..')) {
|
||||
http_response_code(400);
|
||||
@@ -26,7 +27,7 @@ curl_setopt_array($curl, [
|
||||
CURLOPT_CUSTOMREQUEST => $method,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_CONNECTTIMEOUT => 3,
|
||||
CURLOPT_TIMEOUT => 310,
|
||||
CURLOPT_TIMEOUT => $isSnapshotFileRequest ? 1250 : 310,
|
||||
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user