HTTP中的隐式LWS是什么意思?

3

现在我正在阅读一些关于http的RFC文档,但是我不理解其中隐含的LWS(线性空格)的含义?隐含的LWS指的是即使在规则的描述中也包括LWS,但是LWS不会出现在规则的最终扩展中吗?这只是为了让我们清楚地看到标记吗?有人能帮我回答这个问题吗?


你能发一个例子吗? - David
如果您拼写出“LWS”,可能会有所帮助。 - Dwayne Towell
你是在指RFC 822吗? - Riz
1个回答

4
我假设问题涉及到RFC 2616第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.

目标似乎是通过不显式包含空格来使语法更易读。然而,这个规则的实际解释很棘手。例如,一个请求

GET / HTTP/1.1
Host: example.org

实际被发送的
GET   /   HTTP   /   1   .   1
Host   :   example.org

相反,实现方式有所不同。

新的HTTP RFC(RFC 7230)进行了改进,取消了以前的做法,并在语法中明确指定了允许的空格。(包括BWS“坏空格”,它仅允许支持旧版实现,但不得由符合规范的实现产生。)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接