zipcontent returns 304 before checking the entry exists, and 500 for non-zip files
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu với contentcuration/contentcuration/views/zip.py, đặc biệt là phần kiểm tra If-Modified-Since, trình xử lý BadZipfile và POSSIBLE_ZIPPED_FILE_EXTENSIONS. Đọc test_invalid_zip trong contentcuration/contentcuration/tests/test_zipcontentview.py và bổ sung kiểm thử cho các yêu cầu có điều kiện đối với mục bị thiếu và mục hiện có. Công việc hoàn tất khi các mục không tồn tại và tệp zip không hợp lệ hoặc không được hỗ trợ trả về 404 mà không có báo cáo Sentry, còn phản hồi 304 cho một mục hiện có bao gồm cùng các header CORS như phản hồi 200.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 212
- Fork
- 321
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của learningequality/studio
-
Community library status changes don't update `date_updated`Có thể đã có người làm @LightCreator1007 đã nhận 1 ngày trước. Đang mởDEV: backend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
learningequality/studio#6414 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
learningequality/studio#6410 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
learningequality/studio#6409 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/studio#6404 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/studio#6400 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của learningequality/studio
Issue tương tự
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingCó thể đã có người làm @yipinghuang1991 đã nhận hôm nay. Đang mởcomp/agent P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NousResearch/hermes-agent#156837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsCó thể đã có người làm @muskan-creates352 đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
fedora-infra/anitya#2188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs documentation need-triage SaaS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
integration:hermes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vectorize-io/hindsight#6601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage:product type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
dbt-labs/dbt-adapters#2333 ·
Maintainer thường phản hồi trong vòng 1 ngày