现在我正在阅读一些关于http的RFC文档,但我可以理解隐含的LWS(线性空白)的含义?
隐式LWS只是指即使在规则的描述中也存在LWS,但在规则的最终扩展中不会出现LWS?它只是让我们清楚地看到代币?
有人可以帮我解答这个问题吗?
我认为问题涉及以下内容 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“坏空白”,仅允许用于支持遗留实现,但不得由一致的实现生成。)