What does “WARN Could not determine content-length of response body.” mean and how to I get rid of it?

前端 未结 9 2669
离开以前
离开以前 2020-11-27 09:35

Since upgrading to Rails 3.1 I\'m seeing this warning message in my development log:

WARN Could not determine content-length of response body. Set co

9条回答
  •  情歌与酒
    2020-11-27 09:57

    If you're using .rvm, do this to fix it...

    As mentioned by João Soares, all credits to him, this is what you can do if you wan't to get rid of this warning on development.

    1. Use your favorite editor to open this file:

      ~/.rvm/rubies//lib/ruby/1.9.1/webrick/httpresponse.rb
      
    2. Go to the line that contains this(for me it was really line 206):

      if chunked? || @header['content-length']
      
    3. Change it, taken from this patch, to this:

      if chunked? || @header['content-length'] || @status == 304 || @status == 204
      
    4. Save the file and eventually restart your rails server

提交回复
热议问题