Consider using HTTP error response statuses where appropriate
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by locating the Scotty route handlers and the nginx configuration for compile.purescript.org. Review how oversized bodies, compilation failures, missing endpoints, and deployment failures currently respond; done means the appropriate HTTP statuses and CORS behavior are defined and applied consistently.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Right now, the API server returns 200 responses basically unconditionally. The readme says:
Among other things, this makes it easier to use the API from another domain using CORS.
But I don't think this is quite true, because according to my reading of the CORS spec, 4xx and 5xx responses should be visible as long as the appropriate Access-Control-Allow-Origin header is set. It's only preflight requests which must return 2xx responses for the request to succeed, and we don't need to use those because we only use "simple methods" (GET and POST).
I think a 200 response in the case where the code failed to compile is appropriate, but I don't think it's appropriate in a case where we are refusing the process the request because the body is too large; the 413 Request Entity Too Large response seems more appropriate for that. I'm not sure what the best way to handle modules not called Main is.
Relatedly, I think we should add the appropriate CORS headers (in particular Access-Control-Allow-Origin: *) for compile.purescript.org in nginx, rather that on the individual scotty routes as we are doing currently. This way, clients from different origins would be able to handle errors which occur outside of the handling of those particular routes in Scotty, such as 404s for non existent endpoints, or 502s for if a deployment has gone wrong.
- Lenguaje dominante
- PureScript
- Estrellas
- 121
- Forks
- 51
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 purescript/trypurescript
-
Add options for bare-bones use Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
purescript/trypurescript#309 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
purescript/trypurescript#308 ·
-
Publish as a library Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
purescript/trypurescript#303 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
purescript/trypurescript#301 · 1 comentario · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
purescript/trypurescript#293 · 7 comentarios ·
Todos los issues de purescript/trypurescript
Issues similares
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
get-convex/migrations#69 ·
-
Observer env strips CLAUDE_CODE_TMPDIR, which is the documented fix for a fatal temp-dir error Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
thedotmack/claude-mem#4161 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
connectrpc/connect-py#342 ·
-
01 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
plone/cookieplone-templates#471 ·