double quotes in headers can not be parsed
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- networking
Research direction
The header-name map is in src/lib.rs around line 96; start there and reproduce the supplied test_double_quotes case. Check the parser's expected handling of quoted header names, then establish the intended behavior with a regression test or documented decision.
Written by the indexing model from the issue text.
Description
In the header name map, index 34 is false. So when parsing headers, the program will return Error::HeaderName when meeting double quotes(ascii number is 34) . However, bouble quotes in headers can be parsed correctly in chrome. Is this intentional or a bug?
Test Example:
#[test]
fn test_double_quotes() {
use std::mem;
let bytes= b"HTTP/1.1 200 OK\r\nServer: nginx/1.14.2\r\nDate: Mon, 25 Jan 2021 06:20:06 GMT\r\nContent-Type: image/png\r\nContent-Length: 24623\r\nConnection: keep-alive\r\n\"Access-Control-Allow-Origin: *\"\r\nAccept-Ranges: bytes\r\nAccess-Control-Allow-Origin: *\r\nCache-Control: 2592000\r\n\r\n";
let mut headers: [Header; 10] = unsafe { mem::uninitialized() };
let mut res = Response::new(&mut headers);
let parsed_res = res.parse(bytes);
println!("parsed res= {:?}", parsed_res);
}
- Dominant language
- Rust
- Stars
- 713
- Forks
- 134
- 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 seanmonstar/httparse
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
seanmonstar/httparse#222 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
seanmonstar/httparse#210 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
seanmonstar/httparse#196 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
seanmonstar/httparse#162 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
seanmonstar/httparse#161 · 3 comments ·
All issues in seanmonstar/httparse
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100