Comments (3)
At least according to RFC 2616, Chrome's behavior seems correct. A header name is a sequence of token
, and token
is any character excluding CTL
s or SEPARATOR
s, neither of which includes "
. However RFC 7230 (which obsoletes 2616) defines a token
as a sequence of tchar
, a class which specifically excludes double quotes.
I'd think a parser should be able to handle the old definition because it's impossible to tell whether a given message conforms to RFC 2616 or 7230 (both describe HTTP/1.1), but practically the new definition seems to have been changed because parsing the old one is much more complex than it initially seems and many implementations differ in their interpretation.
As a related example, RFC 7230 (section 3.2.4) deprecates line folding for header values and allows servers receiving folded lines to reject them, but also requires user agents to accept folded lines by converting to sequences of spaces before interpreting. In that particular instance, it seems like this library should implement the behavior specified for user agents because that is also permitted for servers.
from httparse.
It seems like the rationale in #68 applies here as well though: supporting the old behavior is difficult and probably slow, so it's simply not supported.
from httparse.
#114 will let you ignore the invalid header, which is what Chrome is doing.
from httparse.
Related Issues (20)
- Headers lost on a Partial parse HOT 1
- HTTP POST Request Example HOT 1
- expose static Error str
- method might not refer to a location within buffer HOT 2
- tests fail to build with --no-default-features.
- Not support http body HOT 1
- support raw UTF8 paths HOT 6
- Invalid end of chunk (parse_chunk_size) HOT 2
- [Question] Why Is the HTTP Version Limited to 1.1? HOT 4
- Add option to save partial header value HOT 1
- `is_token` implementation is more permissive than standard HOT 2
- Returning more information on partial results and errors
- Unsound usages of unsafe implementation from smaller size to larger size HOT 2
- Build fails for x86 targets HOT 8
- httparse 1.9.1 unit tests fail to compile on 32-bit architectures HOT 3
- Beginner Issue : req.parse "Accept-Encoding" header produces Version error HOT 1
- Weird header parsing in 1.9 HOT 2
- httparse 1.9.x breaks header parsing for certain cases HOT 1
- README is outdated HOT 1
- Need for `Request` to take a slice of `MaybeUninit<Header>` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httparse.