Project

General

Profile

Actions

Backport #2593

closed

WEBrickのContent-RangeがRFCに準拠していない

Added by kinumi (Kunimi Ikeda) over 14 years ago. Updated almost 13 years ago.


Description

=begin
[ruby-dev:29894]でも指摘されていましたが、
WEBrickのContent-RangeがRFCに準拠していないようです。

RFCではContent-Rangeは以下のように定義されているようですが、
bytes-unitの部分がWEBrickから出力されていません。

  Content-Range = "Content-Range" ":" content-range-spec
  content-range-spec      = byte-content-range-spec
  byte-content-range-spec = bytes-unit SP
                            byte-range-resp-spec "/"
                            ( instance-length | "*" )
  byte-range-resp-spec = (first-byte-pos "-" last-byte-pos)
                                 | "*"
  instance-length           = 1*DIGIT

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

具体的な不都合としては、iPhoneへのmp4配信が出来ません。
=end


Files

diff.patch (604 Bytes) diff.patch kinumi (Kunimi Ikeda), 01/11/2010 04:11 PM
patch-test-webrick.diff (1.49 KB) patch-test-webrick.diff kimuraw (Wataru Kimura), 06/11/2010 03:01 AM
patch-lib-net-http.rb.diff (709 Bytes) patch-lib-net-http.rb.diff fix Net::HTTPHeader#content_range from 1.8 r27918 kimuraw (Wataru Kimura), 06/11/2010 03:01 AM
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r26346.
Kunimi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) about 14 years ago

  • Status changed from Closed to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin

=end

Actions #3

Updated by shyouhei (Shyouhei Urabe) almost 14 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r27918.
Kunimi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Updated by kimuraw (Wataru Kimura) almost 14 years ago

=begin
追加されたテストが次のようにエラーになります。
ruby 1.8.7 (2010-06-10 patchlevel 294) [i686-darwin10.3.0]で確認しました。

  1. Error:
    test_filehandler(WEBrick::TestFileHandler):
    NameError: undefined local variable or method log' for #<WEBrick::TestFileHandler:0x103637b40> ./test/webrick/test_filehandler.rb:96:in test_filehandler'
    /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1054:in request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:2144:in reading_body'
    /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1053:in request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1037:in request'
    /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:543:in start' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1035:in request'
    ./test/webrick/test_filehandler.rb:95:in test_filehandler' ./test/webrick/utils.rb:38:in call'
    ./test/webrick/utils.rb:38:in start_server' ./test/webrick/utils.rb:46:in start_httpserver'
    ./test/webrick/test_filehandler.rb:79:in `test_filehandler'
    ====
    1.8からもってきたテストコードが不足しているようです。
    添付したパッチpatch-test-webrick.diffでテストが実行できるようになります。

また、このパッチを当てるとテストの実行結果は以下のようになります。

  1. Failure:
    test_filehandler(WEBrick::TestFileHandler)
    [./test/webrick/test_filehandler.rb:100:in test_filehandler' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1054:in request'
    /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:2144:in reading_body' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1053:in request'
    /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1037:in request' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:543:in start'
    /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1035:in request' ./test/webrick/test_filehandler.rb:95:in test_filehandler'
    ./test/webrick/utils.rb:44:in call' ./test/webrick/utils.rb:44:in start_server'
    ./test/webrick/utils.rb:52:in start_httpserver' ./test/webrick/test_filehandler.rb:79:in test_filehandler']:
    webrick log start:
    [2010-06-11 02:43:53] INFO WEBrick 1.3.1
    [2010-06-11 02:43:53] INFO ruby 1.8.7 (2010-06-10) [i686-darwin10.3.0]
    [2010-06-11 02:43:53] INFO WEBrick::HTTPServer#start: pid=25412 port=52634
    webrick log end.
    <9285..9384> expected but was
    <9285..9385>.
    ====

これは1.8のr27918でのNet::HTTPHeader#content_rangeの修正が
1.8.7に反映されていないためだと思います。
http://redmine.ruby-lang.org/issues/show/2688
添付したパッチpatch-lib-net-http.rb.diffでテストをパスするようになります。

=end

Actions #5

Updated by shyouhei (Shyouhei Urabe) almost 14 years ago

  • Status changed from Closed to Assigned

=begin
ふむ。ありがとうございます。なぜ気付かなかったよくわかりませんが、そのへんも含めて調査してみます。
=end

Actions #6

Updated by shyouhei (Shyouhei Urabe) almost 14 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r28336.
Wataru, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0