zipcontent returns 304 before checking the entry exists, and 500 for non-zip files
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza por contentcuration/contentcuration/views/zip.py, especialmente la comprobación de If-Modified-Since, el manejador de BadZipfile y POSSIBLE_ZIPPED_FILE_EXTENSIONS. Lee test_invalid_zip en contentcuration/contentcuration/tests/test_zipcontentview.py y añade cobertura para las solicitudes condicionales de entradas inexistentes y existentes. El trabajo estará terminado cuando las entradas inexistentes y los archivos zip no válidos o no compatibles devuelvan 404 sin un informe de Sentry, mientras que una respuesta 304 para una entrada existente incluya los mismos encabezados CORS que una 200.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 212
- Forks
- 321
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de learningequality/studio
-
Community library status changes don't update `date_updated`Posiblemente ocupada @LightCreator1007 la tomó hace 1 día. AbiertoDEV: backend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
learningequality/studio#6414 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
DEV: backend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
learningequality/studio#6410 ·
Los mantenedores suelen responder en 1 día
-
DEV: backend
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
learningequality/studio#6409 ·
Los mantenedores suelen responder en 1 día
-
DEV: backend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
learningequality/studio#6404 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
DEV: backend good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
learningequality/studio#6400 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de learningequality/studio
Issues similares
-
[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 retryingPosiblemente ocupada @yipinghuang1991 la tomó hoy. Abiertocomp/agent P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NousResearch/hermes-agent#156837 ·
Los mantenedores suelen responder en 1 día
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsPosiblemente ocupada @muskan-creates352 la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
fedora-infra/anitya#2188 ·
Los mantenedores suelen responder en 1 día
-
docs documentation need-triage SaaS
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
integration:hermes
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
vectorize-io/hindsight#6601 ·
Los mantenedores suelen responder en 1 día
-
triage:product type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
dbt-labs/dbt-adapters#2333 ·
Los mantenedores suelen responder en 1 día