Is it valid to leave Accept-Encoding field empty?

浪尽此生 提交于 2019-12-11 03:47:30

问题


I found the example of Accept-Encoding violates the specification in the document:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14#sec14.3

The "Accept-Encoding" header field is defined as below:

   Accept-Encoding  = "Accept-Encoding" ":"
                      1#( codings [ ";" "q" "=" qvalue ] )

So according to the syntax of 1#(...), it should contain at least one element in the value list. But one of the examples comes after it is:

   Accept-Encoding:

It has a blank value part. Did I miss anything? And could anyone tell me is this usage valid or not?


回答1:


You really should stop looking at RFC 2616. See http://trac.tools.ietf.org/wg/httpbis/trac/wiki.

The answer to your question is here: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/25, so yes, an empty field value is valid.



来源:https://stackoverflow.com/questions/14562572/is-it-valid-to-leave-accept-encoding-field-empty

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