0

您能否告诉我以下语法是否与 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”进行分析,但没有成功。

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

4

1 回答 1

0

该规则在rfc3261的第 25.1 节中定义

在大多数情况下,可以添加 CRLF 以提高可读性。确保至少有一个 WSP 位于此 CRLF 之后。这有助于在解析时将新标头与 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

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

于 2021-03-06T09:43:08.000 回答