PEP 3333: URL-decoding and routing
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- reStructuredText
- Estrellas
- 5k
- Forks
- 1.8k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 25
Descripción
There have been several discussions over the years about how WSGI frameworks apply routing in the case of URL-encoded path components. Here's a comment that links to a few of the discussions:
https://github.com/encode/starlette/pull/1828#issuecomment-1434043248
The issue is that when using routing features, the URL /user/foo/edit appears to be indistinguishable from /user/foo%2Fedit, and in case of routing rules for /user/{username} and /user/{username}/edit, the URL /user/foo%2Fedit will match the second rule and not the first.
This seems to me to be in conflict with RFC 3986 section 2.4 and RFC 3986 section 2.2. The latter states:
URIs that differ in the replacement of a reserved character with its corresponding percent-encoded octet are not equivalent.
But the routing mechanism in popular WSGI frameworks such as Flask and FastAPI are unable to differentiate the mentioned URLs, because the URI's percent-encoding is decoded before the routing happens.
I believe PEP-3333 needs to clarify the correct behaviour.
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.
Línea de trabajo
Comienza leyendo PEP 3333 y la discusión enlazada de Starlette; después, compara el comportamiento del enrutamiento descrito allí con las secciones 2.2 y 2.4 de RFC 3986. El trabajo estará terminado cuando el proyecto llegue a un acuerdo sobre una aclaración precisa de cómo deben tratarse los componentes de ruta codificados con porcentajes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- api, backend, documentation
- Tipo de issue
- Documentación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100