zipcontent returns 304 before checking the entry exists, and 500 for non-zip files
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
まず contentcuration/contentcuration/views/zip.py を確認し、特に If-Modified-Since のチェック、BadZipfile ハンドラー、POSSIBLE_ZIPPED_FILE_EXTENSIONS に注目してください。contentcuration/contentcuration/tests/test_zipcontentview.py の test_invalid_zip を読み、存在しないエントリと既存のエントリに対する条件付きリクエストのテストを追加してください。存在しないエントリと無効または未対応の zip ファイルが Sentry レポートなしで 404 を返し、既存のエントリに対する 304 が 200 と同じ CORS ヘッダーを含めば完了です。
索引モデルが issue の本文から書いたものです。
説明
Overview
ZipContentView answers any request carrying an If-Modified-Since header with 304 before it checks the entry inside the zip exists. For a stored file that isn't a zip, it returns a deliberate 500 and reports it to Sentry on every request. Both are reachable anonymously.
Complexity: Low
Target branch: hotfixes
Context
All behaviour below was reproduced:
- The
If-Modified-Sincecheck runs before the lookup.If-Modified-Since: garbageon a nonexistent entry returns 304 instead of 404, and the 304 has none of the CORS headers the 200 carries. - The
BadZipfilehandler returnsHttpResponseServerErrorand callscapture_message./zipcontent/<checksum>.pdf/index.htmlreaches it.POSSIBLE_ZIPPED_FILE_EXTENSIONSis defined but never checked. test_invalid_zipincontentcuration/contentcuration/tests/test_zipcontentview.pyasserts the 500.- Related: #906, #844.
The Change
If-Modified-Sinceshould only produce a 304 for an entry that exists, and the 304 should carry the same CORS headers as the 200.- A request for a stored file whose extension isn't in
POSSIBLE_ZIPPED_FILE_EXTENSIONS, or that isn't a valid zip, should return 404 without a Sentry report.
Acceptance Criteria
General
- A request with any
If-Modified-Sincefor a nonexistent entry returns 404. - A request with
If-Modified-Sincefor an existing entry returns 304 with the same CORS headers as the 200. -
/zipcontent/<checksum>.pdf/index.htmlreturns 404 and sends nothing to Sentry.
Testing
-
test_invalid_zipasserts 404, and new tests cover the twoIf-Modified-Sincecases.
AI usage
I scoped the audit. Claude Code found and reproduced these failures and drafted this issue.
- 主要言語
- Python
- スター
- 212
- フォーク
- 321
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
learningequality/studio のほかの issue
-
Community library status changes don't update `date_updated`対応中かも @ArpitaSamanta10 が今日担当しました。 オープンcommunity-contribution-in-progress DEV: backend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
learningequality/studio#6414 · コメント 8 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
DEV: backend
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
learningequality/studio#6410 ·
メンテナーはふだん 1 日以内に返信
-
DEV: backend
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
learningequality/studio#6409 ·
メンテナーはふだん 1 日以内に返信
-
Stripe webhook accepts events when no webhook secret is configured対応中かも @adibmbrk が今日担当しました。 オープンcommunity-contribution-in-progress DEV: backend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
learningequality/studio#6404 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Contentnode `requisites` action skips the permission check対応中かも @sreehari-vp が今日担当しました。 オープンcommunity-contribution-in-progress DEV: backend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
learningequality/studio#6400 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
learningequality/studio の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
audit-reference-check
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
site-bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
canonical/paas-charm#407 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信