豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 9c3bf4f

Browse files
committed
Set higher default value for max size of directory listing
1 parent acd3942 commit 9c3bf4f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Client.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ export interface UploadOptions {
5252
export interface ClientOptions {
5353
/** Allow the FTP server to use a different host for transfers. */
5454
allowSeparateTransferHost: boolean
55-
/** The upper bound for directory listings. */
55+
/**
56+
* The upper bound for directory listings, a security measure to avoid unbounded memory consumption.
57+
* You typically don't have to set this, the library picks a reasonable default.
58+
*/
5659
maxListingBytes: number
5760
}
5861

5962
const defaultClientOptions: ClientOptions = {
6063
allowSeparateTransferHost: true,
61-
maxListingBytes: 20 * 1024 * 1024
64+
maxListingBytes: 40 * 1024 * 1024
6265
}
6366
const LIST_COMMANDS_DEFAULT = () => ["LIST -a", "LIST"]
6467
const LIST_COMMANDS_MLSD = () => ["MLSD", "LIST -a", "LIST"]

0 commit comments

Comments
 (0)