Is it valid to leave Accept-Encoding field empty?

2019-07-15 22:33发布

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条回答
女痞
2楼-- · 2019-07-15 22:41

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.

查看更多
登录 后发表回答