mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-30 16:16:19 +00:00
fix: stop cutting off uploads over 10 MB that pass through the server, such as office documents saved from the editor
This commit is contained in:
@@ -12,8 +12,8 @@ import { DisallowedUrlError, fetchPublicUrl } from '@/lib/security/url-guard';
|
||||
import { authHeaderFor, credentialOrigin, privateProxyOrigins, type CredentialInject, type CredentialSpec } from './credentials';
|
||||
import { getUserCredential, setUserCredentialSecret, userKey, type VaultUser } from './vault';
|
||||
|
||||
/** Largest request body the proxy forwards (one upload chunk). */
|
||||
export const MAX_PROXY_REQUEST_BYTES = 512 * 1024 * 1024;
|
||||
/** Largest request body the proxy forwards (one upload chunk); see proxyClientMaxBodySize in next.config.ts. */
|
||||
export const MAX_PROXY_REQUEST_BYTES = 100 * 1024 * 1024;
|
||||
/** Largest response body it passes back (a download). */
|
||||
export const MAX_PROXY_RESPONSE_BYTES = 2 * 1024 * 1024 * 1024;
|
||||
/** Largest response it reads to capture a secret from. */
|
||||
|
||||
@@ -59,6 +59,14 @@ const nextConfig: NextConfig = {
|
||||
// it from node_modules at runtime instead of trying to bundle it. Used by
|
||||
// PLUGIN_DEV_DIR's on-the-fly bundler.
|
||||
serverExternalPackages: ["esbuild"],
|
||||
experimental: {
|
||||
// proxy.ts runs for every request, /api included, and Next buffers the
|
||||
// body for it up to this size and silently cuts off the rest. 10 MB (the
|
||||
// default) truncated WOPI saves and WebDAV uploads of bigger files, and
|
||||
// plugin uploads through /api/plugin-proxy. Keep MAX_PROXY_REQUEST_BYTES
|
||||
// in lib/plugin-secrets/proxy.ts in step with it.
|
||||
proxyClientMaxBodySize: "100mb",
|
||||
},
|
||||
// Response headers are the host's job in a static export (see out/_headers).
|
||||
...(isLite
|
||||
? {}
|
||||
|
||||
Reference in New Issue
Block a user