receiveHTTP does not preprocess the incoming URI before it is parsed
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- haskell
- Domain
- networking
Research direction
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.
Written by the indexing model from the issue text.
Description
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.)
- Dominant language
- Haskell
- Stars
- 186
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/HTTP
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
zip-archive-0.5 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
commercialhaskell/stackage#8124 · 1 comment ·
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
haskellfoundation/haskellfoundation.github.io#637 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
koalaman/shellcheck#3539 ·