mirror of
https://github.com/HeyPuter/puter.git
synced 2026-07-08 08:12:15 +00:00
add whitelist for signed batch uploads (#3196)
This commit is contained in:
committed by
GitHub
parent
d897cc5dd0
commit
0ffc32f19e
@@ -1,7 +1,7 @@
|
||||
import path from '../../../lib/path.js';
|
||||
import * as utils from '../../../lib/utils.js';
|
||||
import getAbsolutePathForApp from '../utils/getAbsolutePathForApp.js';
|
||||
import { showUsageLimitDialog } from '../../../modules/UsageLimitDialog.js';
|
||||
import getAbsolutePathForApp from '../utils/getAbsolutePathForApp.js';
|
||||
|
||||
/* eslint-disable */
|
||||
const MAX_THUMBNAIL_BYTES = 2 * 1024 * 1024;
|
||||
@@ -13,6 +13,7 @@ const SIGNED_BATCH_CHUNK_PIPELINE_CONCURRENCY = 4;
|
||||
const SIGNED_BATCH_FILE_UPLOAD_CONCURRENCY = 8;
|
||||
const SIGNED_MULTIPART_PART_UPLOAD_CONCURRENCY = 8;
|
||||
const SIGNED_BATCH_WRITE_UNAVAILABLE_STATUSES = new Set([404, 405, 501]);
|
||||
const SIGNED_BATCH_SUPPORTED_ENVS = ['web', 'gui', 'app'];
|
||||
|
||||
const isLikelyImageFile = (file) => {
|
||||
if ( ! file ) return false;
|
||||
@@ -605,6 +606,7 @@ const upload = async function (items, dirPath, options = {}) {
|
||||
|
||||
|
||||
const shouldAttemptSignedBatchWrite = (
|
||||
SIGNED_BATCH_SUPPORTED_ENVS.includes(puter.env) &&
|
||||
!options.shortcutTo &&
|
||||
(files.length > 0 || signedDirectories.length > 0) &&
|
||||
signedBatchWriteAllowed
|
||||
|
||||
Reference in New Issue
Block a user