[bug]: Asset upload returns 500 when size is not a number, and accepts zero or negative sizes

未关闭
#10,387 1 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

维护者通常 1 天内回复

@vihar 已经在做这个了。

开始于 2026年11月24日。

  • #10394 来自 @ashokram-si —— 未关闭
  • #10416 来自 @avesh-pathak —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

🐛bug plane
Is there an existing issue for this?
  • I have searched the existing issues
Current behavior

The upload endpoints read the size with int(request.data.get("size", ...)), so a request with "size": "abc" or "size": null fails with ValueError or TypeError and a 500. A size of 0 or -5 is accepted and passed on to the presigned upload.

The same line is in apps/api/plane/app/views/asset/v2.py (user, workspace and project assets), apps/api/plane/api/views/asset.py (three endpoints), apps/api/plane/app/views/issue/attachment.py and apps/api/plane/space/views/asset.py. The work item attachment endpoint of the public API (apps/api/plane/api/views/issue.py) already handles this and answers with a 400.

Steps to reproduce
  1. POST /api/assets/v2/user-assets/ with {"name": "a.png", "type": "image/png", "size": "abc", "entity_type": "USER_AVATAR"}.
  2. The response is a 500 and the log shows invalid literal for int() with base 10: 'abc'.
  3. With "size": -5 the request succeeds with a 200 instead of a 400.
Environment

Production

Browser

None

Edition

Community

Version

v1.5.0 (also on preview at 723bb178f)

主要语言
TypeScript
星标
63k
派生
6.5k
平均合并
2 天 16 小时
30 天内合并 PR
70

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

makeplane/plane 的其他 Issue

查看 makeplane/plane 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。