are multiple linear white space allowed in http he

2019-06-22 11:41发布

I'm trying to understand http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2

HTTP/1.1 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.

   LWS            = [CRLF] 1*( SP | HT )

Can i put any number of <CR><LF><SP>, without putting any header value on the line ? i.e. is this valid : Header:<CR><LF><SP><CR><LF><SP>Value

1条回答
地球回转人心会变
2楼-- · 2019-06-22 12:23

Yes, but see http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p1-messaging-22.html#rfc.section.3.2.4.p.3 - it's deprecated in the upcoming revision of the HTTP spec.

查看更多
登录 后发表回答