Ruby1.9.3ã®Webrickã§åºãCould not determine content-length...ã¨ã©ã¼ãæ¶ãæ¹æ³(2.0.0ã§ã¯è§£æ±ºæ¸)
ãããã
Redmineãèµ·åãã¦ããæã«ä»¥ä¸ã®ãããªãã°ã大éã«åããã³ã³ã½ã¼ã«ãåãå°½ãããã¦å°ã£ãã
[yyyy-mm-dd ...] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
ç°å¢
åèãµã¤ã
- Railsã®ãã°ããâCould not determine content-length â¦âã¨ãã§ã¦ãã®ãæ¶ã - Qiita [ãã¼ã¿]
- Webrickãåºã大éã®ãã°ãææ¢ããã«ã¯ï¼ - QA@IT
- Ruby - Railsãµã¼ãã¼ã® WARN Could not determine content-length⦠ã®ãã°ã表示ããªãããã«ãã - Qiita [ãã¼ã¿]
- rails 3.1.1.rc1 emits warning for each assets when using ruby-1.9.3-rc1 · Issue #3164 · rails/rails · GitHub
- Bug #5737: WEBrick doesnât support keep alive connections for 204 and 304 responses - ruby-trunk - Ruby Issue Tracking System
è§£æ±ºæ¹æ³
以ä¸ã®ãããããã¦ã or 該å½ãã¡ã¤ã«ã夿´ããã
ãã®ãããã¯åãè¾¼ã¾ãã¦ãã¦ãææ°çã ã¨ãªãã£ã¦ãã®ããªï¼
â 2.0.0 ã§ã¯ãªãã£ã¦ãï¼
# Keep-Alive connection.
if @header['connection'] == "close"
@keep_alive = false
elsif keep_alive?
if chunked? || @header['content-length'] || @status == 304 || @status == 204 || HTTPStatus.info?(@status)
@header['connection'] = "Keep-Alive"
else
ã¡ãªã¿ã«ã Railsã®issue ãè¦ãã¨ãã¿ããªçºçãã¦ãæ§åã
RFCã«ã¯ããæ¸ãã¦ããæ¨¡æ§ã
So if you want to do keep-alive, even if you add a content length, you will always get a warning. RFC2616 Section 4.4 says:
1.Any response message which âMUST NOTâ include a message-body (such as the 1xx, 204, and 304 responses and any response to a HEAD request) is always terminated by the first empty line after the header fields, regardless of the entity-header fields present in the message
I think this means that clients will know the length of the body, and clients can support keep-alive connections with no content-length for these types of responses.