Hello!
2012/12/27 Wendal Chen:
>
> test.lua
>
> ngx.exit(ngx.HTTP_NOT_MODIFIED)
>
> curl -v 能够看到:
>
> Content-Length: 0
>
> 但http标准里面, 304是不带Content-Length的吧?
>
1. 首先,Content-Lenght: 0 这个响应头是 Nginx 核心默认生成的,与 ngx_lua 无关;
2. 其次,我看到 RFC 2616 中只规定了 304 响应的响应体须为空:“ The 304 response MUST NOT
contain a message-body, and thus is always terminated by the first
empty line after the header fields. ” 但并没有禁止使用 Content-Length 头,而
Content-Length: 0 也并没有违反响应体为空的要求。难道我漏掉什么了?
Best regards,
-agentzh