Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the meaning of the implied LWS in HTTP?

Tags:

http

Now I am reading some RFC docs about the http, but I can understand the meaning the implied LWS (Linear White Space)?

Implied LWS just means the LWS even in the description of the rule but the LWS will not occur in the finally expansion of the rule? it just make us to see the tokens clearly?

Can someone help me with this question?

like image 971
Adambynes Avatar asked Oct 20 '25 01:10

Adambynes


1 Answers

I assume the question concerns the following from RFC 2616, Section 2.1:

implied *LWS
   The grammar described by this specification is word-based. Except
   where noted otherwise, linear white space (LWS) can be included
   between any two adjacent words (token or quoted-string), and
   between adjacent words and separators, without changing the
   interpretation of a field. At least one delimiter (LWS and/or
   separators) MUST exist between any two tokens (for the definition
   of "token" below), since they would otherwise be interpreted as a
   single token.

The goal, it seems, was to make the grammar more readable by not including white space explicitly. However, the actual interpretation of this rule is fraught. For instance, can a request

GET / HTTP/1.1
Host: example.org

actually be sent as

GET   /   HTTP   /   1   .   1
Host   :   example.org

instead? Implementations vary.

The new-and-improved HTTP RFC, RFC 7230, does away with this, instead putting the allowed whitespace explicitly in the grammar. (Including BWS "bad whitespace" which is allowed only in order to support legacy implementations, but must not be produced by conformant implementations.)

like image 128
Robert Tupelo-Schneck Avatar answered Oct 22 '25 08:10

Robert Tupelo-Schneck