haskell / haskell/HTTP

receiveHTTP does not preprocess the incoming URI before it is parsed

Abierto
#76 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Haskell
Estrellas
186
Forks
59
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Because of the strict parsing of URIs by Network.URI.parseURIReference, parseRequestHead fails on this "almost valid" URI:

```
ghci> parseRequestHead ["GET http://fonts.googleapis.com/css?family=Roboto:300|Open+Sans:700|Open+Sans:300&lang=en HTTP/1.1"]
ghci> Left (ErrorParse "parseRequestHead Request command line parse failure: GET http://fonts.googleapis.com/css?family=Roboto:300|Open+Sans:700|Open+Sans:300&lang=en HTTP/1.1")
```

Replacing the pipe characters with %7C allows the URI to parse.

receiveHTTP, or maybe parseRequestHead, should probably try to escape the characters that are considered invalid for URIs, before sending the string through parseURIReference.

In that regard, `escapeURIString isAllowedInURI` from Network.URI may be handy.

(Something about "be conservative in what you send, be liberal in what you accept" prompted me to raise this issue.)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start by reading receiveHTTP and parseRequestHead, then inspect how the incoming request URI reaches Network.URI.parseURIReference. Check the suggested escapeURIString isAllowedInURI behavior for invalid URI characters, and consider both entry points named in the issue. Done means the shown URI is accepted while already valid URIs continue to parse correctly.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
haskell
Área
networking
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.