Skip to content

[drivers/quark_uc] PUT Object 缺 Content-Type 时上传失败: Bad Parameter: format_type is null #3042

Closed as not planned

Description

@codeislaw-hu

环境

  • OpenList 版本: v4.2.6
  • 存储驱动: Quark (夸克网盘)
  • 场景: 内置 S3 服务 (gofakes3 backend)

复现步骤

  1. 配置夸克存储桶
  2. 使用 S3 客户端上传对象,不发送 Content-Type 头(AWS S3 规范允许省略,默认 application/octet-stream)
  3. 观察上传失败

预期行为

S3 PUT Object 允许省略 Content-Type,服务端应默认为 application/octet-stream 并成功上传。

实际行为

返回 500 InternalError: Bad Parameter: [format_type is null!]

原因分析

drivers/quark_uc/util.go:176 的 upPre 构造上传预检请求时:

"format_type": file.GetMimetype(),

当 S3 客户端未发 Content-Type,file.GetMimetype() 返回空,导致夸克 API 拒绝。

建议修复

在 file.GetMimetype() 为空时回退为 application/octet-stream,或在 Link/Put 阶段补全 MIME 类型。

影响

任何不显式发 Content-Type 的 S3 客户端(如部分 CLI、SDK 默认行为)均无法向夸克存储上传文件。

Activity

  1. jyxjjj commented on Sep 6, 2026

    @jyxjjj
    Member

    不符合提交规范

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions