Skip to content

[BUG] 流式上传对分段式的支持出现了问题 #1100

@wushuo894

Description

@wushuo894

Please confirm the following

  • I have read and agree to AGPL-3.0 Section 15 .
    The program is provided "as is" without any warranties; you bear all risks of using it.

  • I have read and agree to AGPL-3.0 Section 16 .
    The copyright holders and distributors are not liable for any damages resulting from the use or inability to use the program.

  • I confirm my description is clear, polite, helps developers quickly locate the issue, and complies with community rules.

  • I have read the OpenList documentation.

  • I confirm there are no duplicate issues or discussions.

  • I confirm this is an OpenList issue, not caused by other reasons (such as network, dependencies, or operation).

  • I believe this issue must be handled by OpenList and not by a third party.

  • I confirm this issue is not fixed in the latest version.

OpenList Version (required)

v4.1.1

Storage Driver Used (required)

123

Bug Description (required)

v4.1.1 的改动导致流式上传对分段式 (Chuncked模式) 的支持发生了问题

涉及api: /api/fs/put

呈现状态: 上传后文件大小为0kb

复现代码:

        HttpConfig httpConfig = new HttpConfig()
                // Chuncked模式
                .setBlockSize(1024 * 1024 * 50);

        String s = "/Users/wushuo/Documents/HMCL/HMCL-3.5.5.jar";

        HttpRequest.put("http://xxxxx:5244/api/fs/put")
                .timeout(1000 * 60 * 2)
                .setConfig(httpConfig)
                .header(Header.AUTHORIZATION, "xxxxx")
                .header("As-Task", "true")
                .header("File-Path", "/123/101")
                .header(Header.CONTENT_LENGTH, new File(s).length() + "")
                .contentType("application/octet-stream")
                .body(ResourceUtil.getResourceObj(s))
                .then(HttpResponse::isOk);

在4.1.0可以正常上传

Configuration File Content (required)

Logs (optional)

No response

Reproduction Link (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions