以下 sintax rfc 3261 是否兼容?

问题描述

您能告诉我以下语法是否与 rfc3261 兼容吗?谢谢。

401 未经授权:

Digest realm="movistar.tel",\r\n   nonce="35e21fba60422a1f2D6a1fde23235c885d287d50e45fd49d56a354",\r\n   algorithm=MD5,\r\n   qop="auth"

或者应该

Digest realm="movistar.tel",nonce="35e21fba60422a1f2D6a1fde23235c885d287d50e45fd49d56a354",algorithm=MD5,qop="auth"

我正在尝试使用“https://github.com/nygge/abnfc/blob/master/samples/sip/rfc3261.abnf”进行分析,但没有成功。

拜托,你能帮我理解这个吗?。对不起,我的英语不好。 谢谢。

解决方法

该规则在 rfc3261

的第 25.1 节中定义

在大多数地方可以添加 CRLF 以提高可读性。确保在此 CRLF 之后至少有一个 WSP。这有助于在解析时区分新标头和 LWS。

SIP header field values can be folded onto multiple lines if the
continuation line begins with a space or horizontal tab.  All linear
white space,including folding,has the same semantics as SP.  A
recipient MAY replace any linear white space with a single SP before
interpreting the field value or forwarding the message downstream.
This is intended to behave exactly as HTTP/1.1 as described in RFC
2616 [8].  The SWS construct is used when linear white space is
optional,generally between tokens and separators.

   LWS  =  [*WSP CRLF] 1*WSP ; linear whitespace
   SWS  =  [LWS] ; sep whitespace

结论:这两行似乎都是有效的。