[bug]: Asset upload returns 500 when size is not a number, and accepts zero or negative sizes
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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
POST /api/assets/v2/user-assets/with{"name": "a.png", "type": "image/png", "size": "abc", "entity_type": "USER_AVATAR"}.- The response is a 500 and the log shows
invalid literal for int() with base 10: 'abc'. - With
"size": -5the 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時間
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
makeplane/plane のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[bug]: Comment external_id is deduplicated per project instead of per work item対応中かも @MishraTanishq619 が 21 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
makeplane/plane#10195 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Missing optional chaining on actor_details and reaction_items in apps/space reactions and votes対応中かも @ghazy2001 が 29 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
makeplane/plane#10111 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
makeplane/plane#10082 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
makeplane/plane の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
frontend testing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
vendrabuck/HERD#1588 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue priority: low
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
art-audio
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100