zipcontent returns 304 before checking the entry exists, and 500 for non-zip files
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia da contentcuration/contentcuration/views/zip.py, in particolare dal controllo If-Modified-Since, dal gestore BadZipfile e da POSSIBLE_ZIPPED_FILE_EXTENSIONS. Leggi test_invalid_zip in contentcuration/contentcuration/tests/test_zipcontentview.py e aggiungi test per le richieste condizionali relative a voci mancanti ed esistenti. Il lavoro è completato quando le voci inesistenti e i file zip non validi o non supportati restituiscono 404 senza un rapporto Sentry, mentre una risposta 304 per una voce esistente include gli stessi header CORS di una risposta 200.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 321
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/studio
-
Community library status changes don't update `date_updated`Forse già presa @LightCreator1007 l’ha presa 1 giorno fa. ApertaDEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
learningequality/studio#6414 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
learningequality/studio#6410 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
learningequality/studio#6409 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6404 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/studio
Issue simili
-
[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 retryingForse già presa @yipinghuang1991 l’ha presa oggi. Apertacomp/agent P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NousResearch/hermes-agent#156837 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsForse già presa @muskan-creates352 l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
fedora-infra/anitya#2188 ·
I maintainer di solito rispondono entro 1 giorno
-
docs documentation need-triage SaaS
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
integration:hermes
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
vectorize-io/hindsight#6601 ·
I maintainer di solito rispondono entro 1 giorno
-
triage:product type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
dbt-labs/dbt-adapters#2333 ·
I maintainer di solito rispondono entro 1 giorno