chore (backend): fix default maxFileSize value
This commit is contained in:
parent
9a56562a6d
commit
e80113ae6f
4 changed files with 5 additions and 5 deletions
2
packages/backend-rs/index.d.ts
vendored
2
packages/backend-rs/index.d.ts
vendored
|
@ -217,7 +217,7 @@ export interface Config {
|
|||
proxySmtp?: string
|
||||
proxyBypassHosts?: Array<string>
|
||||
allowedPrivateNetworks?: Array<string>
|
||||
maxFileSize?: number
|
||||
maxFileSize: number
|
||||
accessLog?: string
|
||||
clusterLimits: WorkerConfig
|
||||
cuid?: IdConfig
|
||||
|
|
|
@ -200,7 +200,7 @@ pub struct Config {
|
|||
pub proxy_smtp: Option<String>,
|
||||
pub proxy_bypass_hosts: Option<Vec<String>>,
|
||||
pub allowed_private_networks: Option<Vec<String>>,
|
||||
pub max_file_size: Option<i64>,
|
||||
pub max_file_size: i64,
|
||||
pub access_log: Option<String>,
|
||||
pub cluster_limits: WorkerConfig,
|
||||
pub cuid: Option<IdConfig>,
|
||||
|
@ -309,7 +309,7 @@ pub fn load_config() -> Config {
|
|||
proxy_smtp: server_config.proxy_smtp,
|
||||
proxy_bypass_hosts: server_config.proxy_bypass_hosts,
|
||||
allowed_private_networks: server_config.allowed_private_networks,
|
||||
max_file_size: server_config.max_file_size,
|
||||
max_file_size: server_config.max_file_size.unwrap_or(262144000),
|
||||
access_log: server_config.access_log,
|
||||
cluster_limits,
|
||||
cuid: server_config.cuid,
|
||||
|
|
|
@ -20,7 +20,7 @@ export async function downloadUrl(url: string, path: string): Promise<void> {
|
|||
|
||||
const timeout = 30 * 1000;
|
||||
const operationTimeout = 60 * 1000;
|
||||
const maxSize = config.maxFileSize || 262144000;
|
||||
const maxSize = config.maxFileSize;
|
||||
|
||||
const req = got
|
||||
.stream(url, {
|
||||
|
|
|
@ -43,7 +43,7 @@ const errorRouter = new Router();
|
|||
const upload = multer({
|
||||
storage: multer.diskStorage({}),
|
||||
limits: {
|
||||
fileSize: config.maxFileSize || 262144000,
|
||||
fileSize: config.maxFileSize,
|
||||
files: 1,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue