are multiple linear white space allowed in http header

爱⌒轻易说出口 提交于 2019-12-10 14:36:10

问题


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:


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.



来源:https://stackoverflow.com/questions/17463676/are-multiple-linear-white-space-allowed-in-http-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!